I have a form that does not want to align itself.
I have tried to show lines how I want the alignment on the attached image, hope it helps.
I want the right hand textboxes to pull-right (as per the blue line on the image, does not work when i add it to the class), and the drop down boxes to fill so that they are the same size as the textboxes (as per the green lines on the image).
Code below :)
<div class="container" style="margin-top: 75px;">
<div class="row">
<div class="col-md-5" style="padding-bottom: 50px;">
<h2>Ansök nu och spara tusentals kronor</h2>
Fyll i dina uppgifter och jämför lån från Sveriges ledande banker. Du kan låna upp till 500 000kr från 3,5% i ränta.<br />
<br />
Endast en kreditupplysning görs genom Conteo, men sin ansökan om lån skickas till alla våra samarbetsbanker. En budgivning mellan bankerna påbörjas och du får resultatet inom 24 timmar.
</div>
<div class="col-md-2">.col-md-2</div>
<div class="col-md-5">
<div class="loan-form">
<h3>Hur mycket vill du låna?</h3>
<div>
<b>Lånebelopp</b><span class="pull-right"><span style="font-weight: bold;" id="loanamount">100 000</span> kr</span><br />
<div id="mainloan_slider"></div>
</div>
<br />
<br />
<div>
<b>Återbetalningstid</b><span class="pull-right"><span style="font-weight: bold;" id="repaymenttime">8</span> år</span><br />
<div id="repaymenttime_slider"></div>
</div>
<br />
<hr style="background-color: #E6C485; height: 2px;" />
<div class="form-inline">
<div class="form-group row">
<div class="col-md-6">
<asp:TextBox ID="txtFirstname" runat="server" CssClass="form-control loan-form-textbox" placeholder="förnamn"></asp:TextBox>
</div>
<div class="col-md-6">
<asp:TextBox ID="txtLastname" runat="server" CssClass="form-control loan-form-textbox pull-right" placeholder="efternamn"></asp:TextBox>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-md-6">
<asp:TextBox ID="TextBox3" runat="server" CssClass="form-control loan-form-textbox" placeholder="personnummer"></asp:TextBox>
</div>
<div class="col-md-6">
<asp:TextBox ID="TextBox4" runat="server" CssClass="form-control loan-form-textbox pull-right" placeholder="email"></asp:TextBox>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-sm-6">
<asp:TextBox ID="TextBox1" runat="server" CssClass="form-control loan-form-textbox" placeholder="hemnummer"></asp:TextBox>
</div>
<div class="col-sm-6">
<asp:TextBox ID="TextBox2" runat="server" CssClass="form-control loan-form-textbox pull-right" placeholder="mobilnummer"></asp:TextBox>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-sm-6">
<asp:DropDownList ID="ddCivilstand" runat="server" CssClass="form-control loan-form-textbox">
<asp:ListItem Text="Gift" Value="1"></asp:ListItem>
<asp:ListItem Text="Singel" Value="2"></asp:ListItem>
<asp:ListItem Text="Skild" Value="3"></asp:ListItem>
<asp:ListItem Text="Änka/Änkeman" Value="4"></asp:ListItem>
<asp:ListItem Text="Separerad" Value="5"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-sm-6">
<asp:DropDownList ID="ddEmploymentType" runat="server" CssClass="form-control loan-form-textbox">
<asp:ListItem Text="Annat" Value="0"></asp:ListItem>
<asp:ListItem Text="Fast anställd" Value="1"></asp:ListItem>
<asp:ListItem Text="Egen företagare" Value="2"></asp:ListItem>
<asp:ListItem Text="Visstidsanställd" Value="3"></asp:ListItem>
<asp:ListItem Text="Pensionär" Value="4"></asp:ListItem>
<asp:ListItem Text="Student" Value="5"></asp:ListItem>
<asp:ListItem Text="Arbetslös" Value="6"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-sm-6">
<asp:DropDownList ID="ddChildren" runat="server" CssClass="form-control loan-form-textbox">
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
<asp:ListItem Text="4" Value="4"></asp:ListItem>
<asp:ListItem Text="5" Value="5"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-sm-6">
<asp:DropDownList ID="ddAccomnodationType" runat="server" CssClass="form-control loan-form-textbox">
<asp:ListItem Text="Annat" Value="1"></asp:ListItem>
<asp:ListItem Text="Hyresrätt" Value="2"></asp:ListItem>
<asp:ListItem Text="Bostadsrätt" Value="3"></asp:ListItem>
<asp:ListItem Text="Inneboende" Value="4"></asp:ListItem>
<asp:ListItem Text="Villa/Radhus" Value="5"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-md-6">
<asp:TextBox ID="TextBox5" runat="server" CssClass="form-control loan-form-textbox" placeholder="boendekostnad"></asp:TextBox>
</div>
<div class="col-md-6">
<asp:Button ID="btnApply" runat="server" Text="Ansök nu" CssClass="btn btn-primary pull-right" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Bootstrap columns have padding on right and left sides, this means that aligning to the right will not be at the edge. to align to the right edge, add style="padding-right: 0;" to elements you need pulled right (it would be better if you use a class rather than inline code .col-pull-right{padding-right: 0;}
The box sizing problem should be solved by removing form-inline class at
<div class="form-inline">
Here the full code. Note i have used final html elements for the code above.
<!DOCTYPE html>
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container" style="margin-top: 75px;">
<div class="row">
<div class="col-md-5" style="padding-bottom: 50px;">
<h2>Ansök nu och spara tusentals kronor</h2>
Fyll i dina uppgifter och jämför lån från Sveriges ledande banker. Du kan låna upp till 500 000kr från 3,5% i ränta.<br />
<br />
Endast en kreditupplysning görs genom Conteo, men sin ansökan om lån skickas till alla våra samarbetsbanker. En budgivning mellan bankerna påbörjas och du får resultatet inom 24 timmar.
</div>
<!-- can be replaced by col-md-offset-2 on element below it -->
<div class="col-md-2">.col-md-2</div>
<div class="col-md-5">
<div class="loan-form">
<h3>Hur mycket vill du låna?</h3>
<div>
<b>Lånebelopp</b><span class="pull-right"><span style="font-weight: bold;" id="loanamount">100 000</span> kr</span><br />
<div id="mainloan_slider"></div>
</div>
<br />
<br />
<div>
<b>Återbetalningstid</b><span class="pull-right"><span style="font-weight: bold;" id="repaymenttime">8</span> år</span><br />
<div id="repaymenttime_slider"></div>
</div>
<br />
<hr style="background-color: #E6C485; height: 2px;" />
<!-- remove class form-inline from here -->
<!--<div class="form-inline"> -->
<div>
<div class="form-group row">
<div class="col-md-6">
<input ID="txtFirstname" class="form-control loan-form-textbox" placeholder="förnamn"/>
</div>
<div class="col-md-6">
<input ID="txtLastname" class="form-control loan-form-textbox pull-right" placeholder="efternamn"/>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-md-6">
<input ID="TextBox3" class="form-control loan-form-textbox" placeholder="personnummer"/>
</div>
<div class="col-md-6">
<input ID="TextBox4" class="form-control loan-form-textbox pull-right" placeholder="email"/>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-sm-6">
<input ID="TextBox1" class="form-control loan-form-textbox" placeholder="hemnummer"/>
</div>
<div class="col-sm-6">
<input ID="TextBox2" class="form-control loan-form-textbox pull-right" placeholder="mobilnummer"/>
</div>
</div>
<div class="form-group row" style="margin-top:25px; padding-right: 0">
<div class="col-sm-6">
<select ID="ddCivilstand" class="form-control loan-form-textbox">
<option value=""> Gift</option>
<option value=""> Singel</option>
<option value=""> Skild</option>
<option value=""> Änka/Änkeman</option>
<option value=""> Separerad</option>
</select>
</div>
<div class="col-sm-6">
<select ID="ddEmploymentType" class="form-control loan-form-textbox">
<option value=""> Annat</option>
<option value=""> Fast anställd</option>
<option value=""> Egen företagare</option>
<option value=""> Visstidsanställd</option>
<option value=""> Pensionär</option>
<option value=""> Student</option>
<option value=""> Arbetslös</option>
</select>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-sm-6">
<select ID="ddChildren" class="form-control loan-form-textbox">
<option value=""> 1</option>
<option value=""> 2</option>
<option value=""> 3</option>
<option value=""> 4</option>
<option value=""> 5</option>
</select>
</div>
<div class="col-sm-6">
<select ID="ddAccomnodationType" class="form-control loan-form-textbox">
<option value=""> Annat</option>
<option value=""> Hyresrätt</option>
<option value=""> Bostadsrätt</option>
<option value=""> Inneboende</option>
<option value=""> Villa/Radhus</option>
</select>
</div>
</div>
<div class="form-group row" style="margin-top:25px;">
<div class="col-md-6">
<input ID="TextBox5" class="form-control loan-form-textbox" placeholder="boendekostnad"/>
</div>
<div class="col-md-6">
<button ID="btnApply" class="btn btn-primary pull-right">Ansök nu</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Related
I'm learning to develop a webform. I want to run set of codes again when button is clicked. Can anyone please help me. asp IDs should also be changed for new items. As an example ID="itemCode1" should changed to itemCode2 in the second instance in 3rd itemcode 3 and so on. It is better if the button is moved to last row after clicking
<div class="form-group col-md-2">
<label>Item Code</label>
<div class="form-group">
<asp:TextBox Cssclass="form-control" ID="Itemcode1" runat="server" placeholder="Enter Item Code" ></asp:TextBox>
</div>
</div>
<div class="form-group col-md-2">
<label>Item Name</label>
<div class="form-group">
<asp:TextBox Cssclass="form-control" ID="ItemName" runat="server" placeholder="Enter Item Name" ></asp:TextBox>
</div>
</div>
<div class="form-group col-md-2">
<label>Select The Range</label>
<asp:CheckBoxList ID="CheckBoxList1" TabIndex="2" CssClass="rangecheckbox" RepeatDirection="Vertical" runat="server">
<asp:ListItem Text="Casabalanca (X05)" Value="Casabalanca (X05)"></asp:ListItem>
<asp:ListItem Text="Monaco (X07)" Value="Monaco (X07)"></asp:ListItem>
<asp:ListItem Text="Akoya" Value="Akoya"></asp:ListItem>
<asp:ListItem Text="Scintilla" Value="Scintilla"></asp:ListItem>
<asp:ListItem Text="Enigma" Value="Enigma"></asp:ListItem>
<asp:ListItem Text="BigRocker" Value="BigRocker"></asp:ListItem>
</asp:CheckBoxList>
</div>
<div class="form-group col-md-1">
<label>No Of Cavities</label>
<div class="form-group">
<asp:TextBox Cssclass="form-control" ID="NoOfCavities" runat="server" placeholder="Enter No of Cavities" ></asp:TextBox>
</div>
</div>
<div class="form-group col-md-2">
<label>Add the photo</label>
<div class="form-group">
<asp:FileUpload Cssclass="form-control" ID="ItemPhoto" type="submit" runat="server" text="Upload Photo" ></asp:FileUpload>
</div>
</div>
<div class="form-group col-md-1">
<label>Material</label>
<div class="form-group">
<asp:DropDownList ID="DropDownList1" Cssclass="form-control" runat="server">
<asp:ListItem text="Select" value="Select" />
<asp:ListItem text="PC" value="PC" />
<asp:ListItem text="Nylon6" value="Nylon6" />
<asp:ListItem text="HIPS" value="HIPS" />
<asp:ListItem text="PBT" value="PBT" />
<asp:ListItem text="ABS" value="ABS" />
<asp:ListItem text="Nylon Fiberfilled" value="Nylon Fiberfilled" />
</asp:DropDownList>
</div>
</div>
<div class="form-group col-md-1">
<asp:Button class="btn btn-primary btn-block" ID="AddAnotherItem" runat="server" Text="AddAnother" />
</div>
</div>
</div>
I am using required field validation control on all textboxes and drop down list. When I press button page is not post back but if any textbox or drop down list is empty it will show error message on button click.
If I use CausesValidation="false" property in button control it will disable all validation control and page will post back on button click.
I want that page will post back on button click and required field validation controls will also work on button click.
<div class="row" id="question">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<asp:TextBox ID="questions" runat="server" class="form-control input-sm floatlabel" placeholder="Question" TextMode="MultiLine"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="textalignment" ErrorMessage="Question is required" ControlToValidate="questions" ForeColor="Red"></asp:RequiredFieldValidator>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<img id="imgprvw" class="img-responsive" />
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<input type="file" name="filUpload" id="filUpload" onchange="showimagepreview(this)" />
</div>
</div>
</div>
</div>
<!-- End Question and Question type Selection -->
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="form-group">
<div class="form-group">
<asp:DropDownList ID="ddlanswers" runat="server" class="form-control input-sm floatlabel" OnChange="showDiv(this)">
<asp:ListItem Text="Answer Type" Value="0"></asp:ListItem>
<asp:ListItem Text="Multiple Choices" Value="1"></asp:ListItem>
<asp:ListItem Text="Fill In The Blacks" Value="2"></asp:ListItem>
<asp:ListItem Text="Multi Select Choices" Value="3"></asp:ListItem>
<asp:ListItem Text="Descriptive Answer" Value="4"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" InitialValue="0" CssClass="textalignment" runat="server" ErrorMessage="Answer Type is required" ControlToValidate="ddlanswers" ForeColor="Red">
</asp:RequiredFieldValidator>
</div>
</div>
</div>
</div>
<div class="row" id="row1">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<asp:TextBox ID="multichoice1" runat="server" class="form-control input-sm floatlabel" placeholder="Multiple Choice 1"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="textalignment" ErrorMessage="Multiple choice is required" ControlToValidate="multichoice1" ForeColor="Red"></asp:RequiredFieldValidator>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<asp:TextBox ID="multichoice2" runat="server" class="form-control input-sm floatlabel" placeholder="Multiple Choice 2"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" CssClass="textalignment" ErrorMessage="Multiple choice is required" ControlToValidate="multichoice2" ForeColor="Red"></asp:RequiredFieldValidator>
</div>
</div>
</div>
<div class="row" id="row2">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<asp:TextBox ID="multichoice3" runat="server" class="form-control input-sm floatlabel" placeholder="Multiple Choice 3"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="textalignment" ErrorMessage="Multiple choice is required" ControlToValidate="multichoice3" ForeColor="Red"></asp:RequiredFieldValidator>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<asp:TextBox ID="multichoice4" runat="server" class="form-control input-sm floatlabel" placeholder="Multiple Choice 4"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" CssClass="textalignment" ErrorMessage="Multiple choice is required" ControlToValidate="multichoice4" ForeColor="Red"></asp:RequiredFieldValidator>
</div>
</div>
</div>
<div class="row" id="row3">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<asp:TextBox ID="TextBox1" runat="server" class="form-control input-sm floatlabel" placeholder="Multiple Choice 5"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" CssClass="textalignment" ErrorMessage="Multiple choice is required" ControlToValidate="multichoice4" ForeColor="Red"></asp:RequiredFieldValidator>
</div>
</div>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" UseSubmitBehavior="false" CssClass="btn btn-default" OnClick="Button1_Click1" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</div>
In button property, remove UseSubmitBehavior="false" or Set UseSubmitBehavior="true".
Hope this help you.
I think it is possible to do this in code-behind in one line of code. Put this in Button1_Click1 method.
ScriptManager.GetCurrent(this).RegisterPostBackControl(Button1);
I am trying to click on an ASP:Button with an onclick function. Every time I do that the HTML5 Required stops the click from occurring. I even tried to include an ASP:UpdatePanel but that does not work neither.
<form id="form1" name="theform" class="form-horizontal" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="fb_login" runat="server">
<asp:button CssClass="btn-facebook" ID="FacebookButton" Text="Login with Facebook" OnClick="FacebookButton_Click" runat="server" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="container">
<div class="form-group">
<label for="FirstName">First Name</label>
<div>
<input type="text" tabindex="1" class="form-control" id="FirstName" required title="Enter First Name" runat="server" placeholder="First Name">
</div>
</div>
<div class="form-group">
<label for="LastName">Last Name</label>
<div>
<input type="text" tabindex="2" class="form-control" id="LastName" required title="Enter Last Name" runat="server" placeholder="Last Name">
</div>
</div>
<div class="form-group">
<div>
<button type="submit" class="btn btn-primary">Submit Information</button>
</div>
</div>
</div>
</form>
Remove the UpdatePanel and set UseSubmitBehavior="false" on FacebookButton:
<asp:button UseSubmitBehavior="false" CssClass="btn-facebook" ID="FacebookButton" Text="Login with Facebook" OnClick="FacebookButton_Click" runat="server" />
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
This is my Text File
R3073101.txt
3070004626!#!JAVEED BASHIR BURZA###BASHIR BURZA###502 BLUE BELLS FLOWER VALLEY NEAR###PAYYEDE HOTEL NAYA NAGAR###MIRA ROAD EAST THANE###401107###502 BLUE BELLS FLOWER VALLEY NEAR###PAYYEDE HOTEL NAYA NAGAR###MIRA ROAD EAST THANE###401107###1###1###N###15###114###FORD FIGO 1 4 EXI###4###1399###5###0###1525###0###2###MAJ1XXMRJ1DU78421###MAJ1XXMRJ1DU78421###C01###K BLUE###1###2014###1/30/2029###307###1###O######PV######541137#########1/31/2014###0###1399###0###0###0###0#####################1/31/2014######################################################################################################################################################################################################NE###1###1/31/2014###1/30/2015###71050131130100129567###HP><401107><1/31/2014###
3070004627!#!SAJID PERVEZ###ALEY AHMED###1005/6 10TH FLR MEGHDOOT A 121###LOKHANDWALA COMPLEX###ANDHERI WEST MUMBAI###400053###1005/6 10TH FLR MEGHDOOT A 121###LOKHANDWALA COMPLEX###ANDHERI WEST MUMBAI###400053###1###1###N###15###114###FORD ECOSPORT 1 5 P TITA AT###4###1499###5###0###1700###0###1###MAJAXXMRKAEL12244###MAJAXXMRKAEL12244###C01###D WHITE###1###2014###1/30/2029###307###N###O######PV######952517#########1/31/2014###0###1499###0###0###0###0#####################1/31/2014######################################################################################################################################################################################################IL###1###1/31/2014###1/30/2015###I24131022###
3070004628!#!ABRAR MALIK###SARDAR MALIK###A/703 PANCHTANTRA APT-II###PANCH MARG VERSOVA###MUMBAI###400061###A/703 PANCHTANTRA APT-II###PANCH MARG VERSOVA###MUMBAI###400061###1###1###N###15###114###FORD ECOSPORT 1 5 P AMB MT###4###1499###5###0###1700###0###1###MAJAXXMRKAEL15204###MAJAXXMRKAEL15204###C01###D WHITE###1###2014###1/30/2029###307###1###O######PV######653670#########1/31/2014###0###1499###0###0###0###0#####################1/31/2014######################################################################################################################################################################################################IL###1###1/31/2014###1/30/2015###PS11225946###HP><400059><1/31/2014###
3070004629!#!A V B AMARAN###BABU ANTHONY CHETTY###B/203 DRONAGIRI MODERN USHA COLONY###EVERSHINE NAGAR MALAD WEST###MUMBAI###400064###B/203 DRONAGIRI MODERN USHA COLONY###EVERSHINE NAGAR MALAD WEST###MUMBAI###400064###1###1###N###15###114###FORD ECOSPORT 1 5 P AMB MT###4###1499###5###0###1700###0###1###MAJAXXMRKAEL15207###MAJAXXMRKAEL15207###C01###M SILVER###1###2014###1/30/2029###307###1###O######PV######653670#########1/31/2014###0###1499###0###0###0###0#####################1/31/2014######################################################################################################################################################################################################NE###1###1/31/2014###1/30/2015###71050131130100129516###HP><3RD FLR A-WING TRADE STAR BLDG><400059><1/31/2014###
3070004630!#!NAROTTAM KUMAR SHARMA###PARMANAND SHARMA###103-B ASTER TOWER FILM CITY ROAD###FILM CITY ROAD MALAD EAST###MUMBAI###400097###103-B ASTER TOWER FILM CITY ROAD###FILM CITY ROAD MALAD EAST###MUMBAI###400097###1###1###N###15###114###FORD ECOSPORT 1 0 P TITA MT###4###999###5###0###1700###0###1###MAJAXXMRKAEL17257###MAJAXXMRKAEL17257###C01###CHILL###1###2014###1/30/2029###307###1###O######PV######895890#########1/31/2014###0###999###0###0###0###0#####################1/31/2014######################################################################################################################################################################################################IL###1###1/31/2014###1/30/2015###I-24134004###HP><400098><1/31/2014###
my .aspx code
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div align="left">
<h3>
<b>New Customer </b>
</h3>
</div>
<br />
<div class="form-horizontal">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Date</label>
<div class="col-sm-6">
<div class="input-group date" data-date="12-02-2012" data-date-format="mm-dd-yyyy" id="datetimepicker1">
<asp:TextBox ID="TextBox1" class="span2" runat="server" Placeholder="Enter Date" CssClass="form-control"></asp:TextBox>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar">
</span>
</span>
</div>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Date Required"
ControlToValidate="TextBox1" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Customer Name</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox2" runat="server" Placeholder="Enter Name" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Customer Name Required"
ControlToValidate="TextBox2" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Regn No</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox3" runat="server" Placeholder="Enter Regn No" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Regn No Required"
ControlToValidate="TextBox3" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Imv</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox4" runat="server" Placeholder="Enter Imv" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ErrorMessage="IMV Required"
ControlToValidate="TextBox4" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Registration Cho</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox5" runat="server" Placeholder="Enter Registration Cho" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Registration CHO Required"
ControlToValidate="TextBox5" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Crtem Fees</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox6" runat="server" Placeholder="Enter Crtem Fees" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Crtem Fees Required"
ControlToValidate="TextBox6" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Crtem S.C</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox7" runat="server" Placeholder="Enter Crtem S.C" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Crtem S.C Required"
ControlToValidate="TextBox7" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
SOC</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox8" runat="server" Placeholder="Enter SOC" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="SOC Required"
ControlToValidate="TextBox8" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Soc S.C
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox9" runat="server" Placeholder="Enter Soc S.C" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="Soc S.c Required"
ControlToValidate="TextBox9" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Spl No.fees
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox10" runat="server" Placeholder="Enter Spl No.Fees" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="Spl No.fees Required"
ControlToValidate="TextBox10" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Spl No.s.c
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox11" runat="server" Placeholder="Enter Spl No.s.c" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="Spl No.s.c Required"
ControlToValidate="TextBox11" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Total No
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox12" runat="server" Placeholder="Enter Total No" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ErrorMessage=" Total No Required"
ControlToValidate="TextBox12" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
No.5
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox13" runat="server" Placeholder="Enter No.5" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ErrorMessage="No.5 Required"
ControlToValidate="TextBox13" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Redium
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox14" runat="server" Placeholder="Enter Redium" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ErrorMessage="Redium Required"
ControlToValidate="TextBox14" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
W.V
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox15" runat="server" Placeholder="Enter W.V" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" ErrorMessage="W.V Required"
ControlToValidate="TextBox15" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
TAX
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox16" runat="server" Placeholder="Enter TAX" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator16" runat="server" ErrorMessage="TAX Required"
ControlToValidate="TextBox16" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Int
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox17" runat="server" Placeholder="Enter Int" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" ErrorMessage="Int Required"
ControlToValidate="TextBox17" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
CF
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox18" runat="server" Placeholder="Enter CF" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator18" runat="server" ErrorMessage="CF Required"
ControlToValidate="TextBox18" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Above 10 Lacs
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox19" runat="server" Placeholder="Enter Above 10 lacs" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator19" runat="server" ErrorMessage="Above 10 Lacs Required"
ControlToValidate="TextBox19" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">
Total
</label>
<div class="col-sm-6">
<asp:TextBox ID="TextBox20" runat="server" Placeholder="Enter Total" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-sm-4">
<asp:RequiredFieldValidator ID="RequiredFieldValidator20" runat="server" ErrorMessage="Total Required"
ControlToValidate="TextBox20" ForeColor="Red" ValidationGroup="val1"></asp:RequiredFieldValidator>
</div>
</div>
<div class="row" style="margin-left: 0px; margin-right: 176px">
<div class="col-md-6">
<asp:Button ID="Button1" runat="server" Text="Submit" CssClass="btn btn-primary"
ValidationGroup="val1" Height="40px" Width="89px" OnClick="btnsubmit_Click" />
</div>
<div class="col-md-6">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</div>
<div class="row" style="margin-left: 0px; margin-right: 176px">
<div class="col-md-6">
<asp:Button ID="Button2" runat="server" Text="Upload" CssClass="btn btn-primary"
Height="40px" Width="89px"
onclick="Button2_Click" />
</div>
<div class="col-md-6">
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</div>
</div>
</div>
</asp:Content>
On the Click of update button my text boxes should get populated according to there name like for ex-: in text file it has first 3070004626=Sr.no!#!JAVEED BASHIR BURZA=name ,like javeed bashir burza should get populated to textbox1.text
Thanks in Advace.
Assuming the format of your txt Files is the same all over you can use this query in your button_Click() method:
var result = from txt in File.ReadAllLines(#"/path/to/your/file")
let column = txt.Split(new [] {'!', '#','#'}).Where (t => t.Length > 0 )
select column.Skip(1).FirstOrDefault();
//Output: JAVEED BASHIR BURZA
textbox1.Text = result.First();
EDIT
If you need all elements and want to iterate over them use the following code:
var result = from txt in File.ReadAllLines(#"/path/to/your/file")
let column = txt.Split(new [] {'!', '#','#'}).Where (t => t.Length > 0 )
select column;
foreach (var element in result)
{
Console.WriteLine(element);
}
<div class="step-content">
<div class="step-pane active" id="step1">
<div class="control-group ">
<label class="control-label" for="inputWarning">Please select the Event Name</label>
<div class="controls">
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="EventName" DataValueField="EventId"></asp:DropDownList>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:WBENCConnectionString %>' SelectCommand="SELECT [EventId], [EventName] FROM [Event]"></asp:SqlDataSource>
</div>
</div>
</div>
<div class="step-pane" id="step2">
<div class="control-group " >
<asp:Label ID="DateLabel" runat="server"></asp:Label>
<div class="controls">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="Yes" Value="Yes"></asp:ListItem>
<asp:ListItem Text="No" Value="No"></asp:ListItem>
</asp:RadioButtonList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="RadioButtonList1" EventName="SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="step-pane" id="step3">
<div class="control-group ">
<label class="control-label" for="inputWarning">
<span class="muted">You can learn more about the program here</span></label>
<div class="controls">
<label class="radio">
<asp:RadioButton ID="Radio1" runat="server" Text="Yes" value="option1" /></label>
<label class="radio">
<asp:RadioButton ID="Radio2" runat="server" Text="No" value="option2" /></label>
<label class="radio">
<asp:RadioButton ID="Radio3" runat="server" Text="Uncertain" value="option2" /></label>
</div>
</div>
</div>
<div class="step-pane" id="step4">
<div class="control-group">
<label class="control-label" for="selectError30">Which days will you be available to participate in the Matchmaker Sessions?</label>
<div class="controls">
<asp:DropDownList ID="selectError30" runat="server" OnDataBound="selectError30_DataBound">
</asp:DropDownList>
</div>
</div>
<div class="control-group">
<label class="control-label">Upload your capability statement. <a style="color: #67c2ef;" href="#">What's this?</a></label>
<div class="controls">
<asp:FileUpload ID="FileUpload1" runat="server" />
</div>
</div>
</div>
here the DropDownlist1_onselectedIndexChanged event got full page load..
and RadioButtonList1 event also get page load...
here how can I use the Update Panel to overcome the full page load....
In my code all events perform Page_Load....
I want to prevent that loading....
If there is a full page load then since panel is inside the page, it will also get refreshed. You can put the drop down inside another update panel. This will prevent the refreshing of radio button update panel.