Wednesday, October 10, 2012

ASP.NET : Binding string or Resource data to html aspx page by using DataBind()

Hello this is simple way again to show how to Bind data in aspx html page.
We have 3 Step below or you want to view coding please see below ^_^
Binding Resource please in extra step.

Step 1 : Define public string variable in code behind page.

public string String1 = "String1";

Step 2 : Add string to your text control (Label TextBox Panel etc.).

<asp:Label ID="lblTest4" runat="server" Text='<%#String1 %>' ></asp:Label>

Step 3 : Add "DataBind();" in Page_Load event.

protected void Page_Load(object sender, EventArgs e) { DataBind(); }

Extra Step : Binding Resource.

<asp:Label ID="lblTest3" runat="server" Text='<%#Resources.Resource.String1 %>' ></asp:Label>

Pls enjoy ZomDev

1 comment:

  1. Its very great article thsnks ZomDevX. dapfor has excllent and great informative tutorial for net you can visit there dapfor. com