1

I have application which support multilingual. Now I have price page which is geo sensitive so that it might be change over location. I am trying to make one template for Html content and changing value from it based on location specific Value. Change value will be append into original html response.

Can somebody help me for such or it is not possible ?

4
  • I don't know how to change html elements via C# but AFAIK you can use a Literal control that is empty when not needed and gets filled with additional data on need time. Commented Jan 28, 2013 at 6:34
  • @MahdiTahsildari thanks for reply. It is pretty well answer but my confusion is that if I am trying something like adding [Price] in html and change this [Price] through code but is this way HTML support ? Commented Jan 28, 2013 at 6:40
  • what about using <asp:label .. Commented Jan 28, 2013 at 7:21
  • @AkilVhora take a look at my answer, I think it's what you need. Commented Jan 28, 2013 at 7:40

1 Answer 1

1

In order to be able to have access to your html controls inside code behind (C#/VB.net code) you need these two steps:

1.add runat=server to your html control definition 2.declare an id for the html control

look at the example below:

Source

<input runat="server" id="Text1" type="text" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />

Code Behind

protected void Button1_Click(object sender, EventArgs e)
{
    Text1.Value = "Mahdi";
}

Text1 is an html control and Button1 is a server control, when you click Button1 the html text controls value changes to "Mahdi".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.