Riddhi Valecha

Riddhi Valecha

  • 442
  • 3.3k
  • 411.6k

div tag alignment from code-behind.

May 6 2015 9:21 AM
Hi all..

I have a webPage.aspx as -

<asp:textbox ID="txt_stud_ID" runat="server"></asp:Textbox>

<asp:textbox ID="txt_FName" runat="server"></asp:Textbox>

<asp:textbox ID="txt_LName" runat="server"></asp:Textbox>

<div id="div_errormsg" runat="server"> </div>

Now,
in aspx.cs code on button click - I have

btn_click
{
if(txt_stud_ID.Lenght > 0 && txt_FName.Lenght > 0 && txt_LName.Lenght > 0)
{
// Insert
}
else
{
div_errormsg.Innertext = "Enter proper values";
}
}
--------
Now, I want that - If Stud_ID is not there, then the "div_errormsg" must be below the Stud_ID text box.
If the FName is not there , then the "div_errormsg" must be below the FName text box.
---
How to align this div from code-behind user the textbox controls ??

Answers (4)