Ask a Question related to ASP.NET General, Design and Development.
-
Paul #1
Modify InnerHtml of HtmlControl with JavaScript?
Here is my current code:
------------
<script runat=Server>
void Page_Load(object sender, EventArgs e){
if (!IsPostBack){
myDiv.InnerHtml = "Original Content";
}
//On Postback, should equal "Original Content and New Content"
string strContent = myDiv.InnerHtml;
}
</script>
<script language=javascript>
function changeDiv(){
myDiv.innerHTML = myDiv.innerHTML + " and New Content";
document.forms(0).submit();
}
</script>
<form runat=Server>
<input type=button name=button value=Change onClick="changeDiv()">
</form>
<DIV id=myDiv runat=Server/>
------------
I need to be able to return the NEW InnerHtml value of "myDiv". The
original value is maintained in the ViewState, but does not reflect
the changes made with Javascript.
I don't want to use the client-side innerHTML property to retrieve the
data. Basically, I am trying to find a way to maintain state when the
changes to the control are client-side.
Any ideas? Thanks.
Paul Guest
-
FP8 IE BUG - innerHtml
Hi everybody. When i make a loadMovie() and load a swf into the master swf a funny thing appends... if you load the master swf into some div via... -
Modify the javascript from CFFORM?
Hi, Is there a way to modify the javascript created by CFFORM. It seems to be created at run-time. I am trying to make one field required if... -
innerhtml problems in IE5/Mac
IE5/Mac users are encountering a problem with a web page that IE/PC users are not encountering. The problem is....I have a form which has an... -
Why can't I make a custom control from System.Web.UI.HtmlControls.HtmlControl?
Scenario: I make a custom control, inheriting from System.Web.UI.HtmlControls.HtmlControl as follows: public class MyControl :... -
Setting the innerHTML on a <span>
Sorry, That was a typo. It should read. I have a RequiredFieldValidator This gets rendered out as a <span> I want to set the innerHTML. -
bruce barker #2
Re: Modify InnerHtml of HtmlControl with JavaScript?
the browser only postbacks input , textarea, and selects, not the entire
html. the server code never see any changes made to div by client script.
-- bruce (sqlwork.com)
"Paul" <paul_nospamplease@yahoo.com> wrote in message
news:354f245e.0308040715.6518e05e@posting.google.c om...> Here is my current code:
> ------------
> <script runat=Server>
> void Page_Load(object sender, EventArgs e){
> if (!IsPostBack){
> myDiv.InnerHtml = "Original Content";
> }
> //On Postback, should equal "Original Content and New Content"
> string strContent = myDiv.InnerHtml;
> }
> </script>
> <script language=javascript>
> function changeDiv(){
> myDiv.innerHTML = myDiv.innerHTML + " and New Content";
> document.forms(0).submit();
> }
> </script>
> <form runat=Server>
> <input type=button name=button value=Change onClick="changeDiv()">
> </form>
> <DIV id=myDiv runat=Server/>
> ------------
>
> I need to be able to return the NEW InnerHtml value of "myDiv". The
> original value is maintained in the ViewState, but does not reflect
> the changes made with Javascript.
>
> I don't want to use the client-side innerHTML property to retrieve the
> data. Basically, I am trying to find a way to maintain state when the
> changes to the control are client-side.
>
> Any ideas? Thanks.
bruce barker Guest



Reply With Quote

