Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request.Form.Get on a div?

Status
Not open for further replies.

Trebor100

Programmer
Mar 14, 2006
90
GB
Hi all,

I need to get to the inner html of a div command. I thought i would have been able to do it with a request.form.get but have had no joy. the html is:

<DIV style="DISPLAY: inline; FONT-WEIGHT: bold; WIDTH: 496px; HEIGHT: 20px" ms_positioning="FlowLayout" id="adminUserAmendLoadTitle" runat="server">SOMETHING</DIV>


the c# line is:

string strPerson = Request.Form.Get("adminUserAmendLoadTitle").ToString();

Any corrections would be sweet.

Cheers,
Rob
 
have you tried putting a runat="server" in your div tag then accessing its properties that way?
 
After adding the runat, you also need to declare that id on the codebehind so ASP.NET can map that element to the corresponding server-side member, so you can then access its properties.

Request.Form normally takes INPUT elements only when the form is submitted.

my 2 cents. [wink]
 
he already had an ID in his DIV, that's why I didn't suggest that too :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top