HI,
I need to do this simple code in html. I need to include a variable(fullname) from Comments.html inl another form like
'Fullname' thankyou for giving us your comments.
thankyou
Printable View
HI,
I need to do this simple code in html. I need to include a variable(fullname) from Comments.html inl another form like
'Fullname' thankyou for giving us your comments.
thankyou
You should have a patter that is not easy to be mixed with the remaining content. For instance you can say:
%%Fullname%% thankyou for giving us your comments.
Then before you display the page get the content and replace the %%Fullname%% with an appropriate value.
Code:TheContent = TheContent.Replace("%%Fullname%%", FullNameTextBox.Text)
Hey,
The code above would be used within the Server Side code of an ASP.Net Application, but you specifically mention using html.
Can you perhaps give some more information about what exactly you are trying to achieve so that we can make sure you get it working.
Gary
I am trying to import the user name (fullname) which is inputted in a textbox from another page within the same webpage and get it to show up. Like
Angelica, thankyou for you comments
where Angelica would have been inputted in the texbox for the username.
this is not an HTML but to get the textbox value of the previous page from the code behind you should do something like:
you can also get the textbox value with the form collectionCode:string FullName = ((TextBox)Page.PreviousPage.FindControl("txbFullName")).Text;
if you using master page and using the "Request.Form" method you should take into consideration that the textbox control ID will change and then you should use the ClientID property.Code:string fullName = Request.Form["txbFullName"];
Hey,
Are these user's people who have logged into your website, or can these be any people? If they are logged into your website already, then you can get this information from the built in methods within the Framework.
Or, in addition to the methods that motil has mentioned, you could put the username into a Session variable, or append it to the QueryString.
There are a number of different ways to do this, it just depends on exactly what you are doing, and why you are doing it.
Gary
Page2:
Label1.Text = String.Format("{0}, thank you for your comments", firstName);
On Page1, you can accept the user's comments in the button click event, save or email it (or whatever you want to do), then either
Response.Redirect("~/page2.aspx?name=" + TextBox1.Text);
or
Session["firstName"] = TextBox1.Text;
Response.Redirect("~/page2.aspx");
Hi ALL,
thanks for your replies. Is there a way to do the same thing using only HTML? I am teaching this class of student where I can only use html and they have no ASP.Net knowledge.
thanks
as far as i know, nope.... maybe with javascript/.
Hey,
If your question was specifically related to using only HTML, why did you post in the ASP.Net forum?
One way you could do this would be to use JavaScript to get the value in the querystring, and change the label value.
Here is one implementation:
http://www.bloggingdeveloper.com/pos...avaScript.aspx
Gary
On the first page, you can set the form's method to get
<form action="page2.html" method="get">
<input type="text" id="fname" name="fname" />
<input type="submit" value="go" />
</form>
When you click submit, it'll go to
page2.html?fname=blah&something=something
So you could then use that javascript to read the querystring and write it to the page. If page2 has a textbox for example, you could use
document.getElementById('page2textbox').value = valueFromQueryString;
Would you like this moved to the HTML forum?
Thanks
Yes I think it more belongs to the HTML . Thankyou.
Moved.
Did you try what we've suggested so far?