asp.net c# Request.Form problem

alfinete

Power Member
eu estou a tirar os valores inseridos no form , passam tdos bem menos o m_GridnoHtml , que passa semopre null quer esteja preenchido quer não,


gstava de uma ajuda para resolver o problema

Código:
   protected void Page_Init(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                setitemsddl();
                //txtcode.Attributes.Add("Readonly", "Readonly");
                //txtName.Attributes.Add("Readonly", "Readonly");
            }


            m_Name = Request.Form["ctl00$ContentPlaceHolder1$wucENBAdministrationschedule1$txtName"];
            m_Grid = Request.Form["ctl00$ContentPlaceHolder1$wucENBAdministrationschedule1$txtGrid"];
            m_GridnoHtml = Request.Form["ctl00$ContentPlaceHolder1$wwucENBAdministrationschedule1$txtGridNohtml"];

           
             

        }

code aspx

Código:
<table id="tblForm" runat="server" border="0" cellpadding="1" cellspacing="2" class="SACTable"
    width="100%">
    <tr>
        <td class="SACMenuTitle" colspan="3">
            <asp:Label ID="lbltitle" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    <tr>
        <td class="SACLabel" style="width: 370px">
            *&nbsp;&nbsp;&nbsp; Nome</td>
        <td>
            &nbsp;<asp:TextBox ID="txtName" runat="server" CssClass="SACTextbox" Width="260px"></asp:TextBox><asp:HiddenField
                ID="hdalter" runat="server" />
        </td>
        <td style="width: 300px">
        </td>
    </tr>
    <tr>
        <td class="SACLabel" style="width: 370px; height: 54px;">
            *&nbsp;&nbsp;&nbsp;Grelha</td>
        <td style="height: 54px">
            &nbsp;<asp:TextBox ID="txtGrid" runat="server" CssClass="SACTextbox" Width="490px" Height="74px" TextMode="MultiLine"></asp:TextBox>
        </td>
        <td style="width: 300px; height: 54px;">
        </td>
    </tr>
    
        <tr>
        <td class="SACLabel" style="width: 370px; height: 68px;">
            *&nbsp;&nbsp;&nbsp;Grelha Sem Html</td>
        <td style="height: 68px">
            &nbsp;<asp:TextBox ID="txtGridNohtml" runat="server" CssClass="SACTextbox" Width="490px" Height="74px" TextMode="MultiLine"></asp:TextBox>
        </td>
        <td style="width: 300px; height: 68px;">
        </td>
    </tr>
  
  
    
</table>
 
descobri

Código:
   m_GridnoHtml = Request.Form["ctl00$ContentPlaceHolder1$[COLOR=Red][SIZE=4][B]w[/B][/SIZE]wuc[/COLOR]ENBAdministrationschedule1$txtGridNohtml"];

tinha um w a mais onde esta a vermelho bold
 
Boas,

Em asp.net, com webcontrols, convem usares os próprios controles, em vez de andares a "adivinhar" qual o nome do controle para colocares no request. Já experimentaste com o txtName.Value? (ou .Text) Tipo:

Código:
 m_GridnoHtml = txtGridNohtml.Text;

Abs
XiriX
 
Back
Topo