Passing Hidden Form Variable to class .asp page

A

Alexander Heimann

Greeting Everyone!


My situation is as follows. I would like to pass a hidden form
variable to a classic asp page. The hiddend form variable I would like
to send is a guid i created using the code below in my login page.
System.Guid myguid = System.Guid.NewGuid();
Session["GUID"] = myguid;


I would like to pass this guid to the classic asp page using a hidden
field in my form I set up the html below
<form id="form1" method="post" runat="server" action ="classicASP.asp"<input type ="text" id="myguid" runat="server">


in my C# code behind i declared the inputfield as
protected System.Web.UI.HtmlControls.HtmlInputHidden myguid;

then in the page load event I attempted to assign myguid the value of


Session["GUID"] = myguid;


I get the error i cannot implicitly convert type 'object' to
"System.Web.UI.HtmlControls.HtmlInputHidden

Any idea's?
Thanks in advance everyone

Alex
 
K

Ken Cox [Microsoft MVP]

You might want to look at the WebClient class and its Uploadvalues method to
do a Post to an ASP page:

http://msdn.microsoft.com/library/d...fsystemnetwebclientclassuploadvaluestopic.asp


Alexander Heimann said:
Greeting Everyone!


My situation is as follows. I would like to pass a hidden form
variable to a classic asp page. The hiddend form variable I would like
to send is a guid i created using the code below in my login page.
System.Guid myguid = System.Guid.NewGuid();
Session["GUID"] = myguid;


I would like to pass this guid to the classic asp page using a hidden
field in my form I set up the html below
<form id="form1" method="post" runat="server" action ="classicASP.asp"<input type ="text" id="myguid" runat="server">


in my C# code behind i declared the inputfield as
protected System.Web.UI.HtmlControls.HtmlInputHidden myguid;

then in the page load event I attempted to assign myguid the value of


Session["GUID"] = myguid;


I get the error i cannot implicitly convert type 'object' to
"System.Web.UI.HtmlControls.HtmlInputHidden

Any idea's?
Thanks in advance everyone

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top