Access innerHTML on serverside

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Is there any way where, from server side, I can access the innerHTML value
of a control (Hyperlink/Label) which is modified at the client side ?
I wish to read the changed InnerHtml on the server side. Can I really do this?

any help will be appretiated.
 
The only way would be to submit it to the server. The server has no
connecttion to the data once its been submitted to the client. You can
probably make the submission more transparent to the end user via AJAX.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
Thank you for the reply John.
I have tried submmiting the form. Even after submitting the form all I can
see is the original innerHtml value of the control, not the modified one. Is
there some thing I am missing here?

This is a draft of my code.
__________________________________________________________________
Server Side:

protected System.Web.UI.HtmlControls.HtmlAnchor anchor;
Page_Load()
{
switch( anchor.innerText )
{
case originalText;
break;
case modifiedText;
break;
}
}
_______________________________________________________________
Client Side:
<a id="anchor" runat="server" href="#"
onClick="JavaScript:ChangeInnerHtml()"></a>
<script language="JavaScript">

function ChangeInnerHtml()
{
document.getElementById("anchor").innerText = "changedInnerHtml";
document.frmMain.submit();
}
</script>

_____________________________________________________________________
 
Hi nLella,

As far as I know, this cannot be done, because when posting back, the
labels are not included. Only the values like textbox values will be post
back. I suggest you try to post in microsoft.public.dotnet.framework.aspnet
for more information.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top