Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi Pls give me a idea abt hideen values in asp.net...

 

 

 

i am doing like this

 

in page1.aspx

<form id="Form1" method="post" runat="server" action="page2.aspx">

<asp:button id="Button1" style="Z-INDEX: 101; LEFT: 320px; POSITION: absolute; TOP: 168px" runat="server"

Text="Button"></asp:button><asp:hyperlink id="HyperLink1" style="Z-INDEX: 102; LEFT: 224px; POSITION: absolute; TOP: 240px"

runat="server" NavigateUrl="page2.aspx?ID=1234">HyperLink</asp:hyperlink>

<input type="hidden" name="hid1" id="hid1" value="777" runat="server">

<input type="hidden" name="hid2" id="hid2" value="888" runat="server">

</form>

i am passing two hideen values

 

i am going to retrieve those in page2.aspx..but i am not

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Response.Write(Request.Form("hid1"))

Response.Write(Request.Form("hid2"))

Response.Write("event")

End Sub

 

 

but i am not getting the values..pls give me the correct code..

 

Thanks

satya

Satya
Posted

If you want to post from page1.aspx to page2.aspx, I suggest you remove all the "runat=server" and use HTML control rather than web control.

 

It will work fine for you like in ASP

  • *Gurus*
Posted

Controls that are declared with their runat attribute set to "server" should not be access with the Request.Forms collection. They should be accessed using their control name.

 

Dim s As String = hid1.Value

 

You should also remove the name attributes that you have defined.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...