|
I need to add One row with Multiple columns on each button click.
Here each column contains textboxes or dropdown list controls.
My table initialy contains one row. After clicking on Add new button, i need to add new row below to the existing table.
Also wants to remove the last row on remove button click.
Plz help me for this
|
|
|
|
|
I thought a gridview already offers this ? Does the grid represent data that ends up in your DB ? If so, I think you should use the functionality built in to the gridview.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have no need to bind data from database.
The purpose is to insert enter details.
i have this code on button click
protected void btnAddNewLine_Click(object sender, EventArgs e)
{
count = count + 1;
addNewline();
btnRemove.Visible = true;
}
public void addNewline()
{
HtmlTableRow tr1= new HtmlTableRow();
tr1.ID = "tr1" + count;
HtmlTableCell tc1 = new HtmlTableCell();
for (int i = 0; i <9 ; i++)
{
tc1 = new HtmlTableCell();
if (i == 0)
{
tc1.Height = "21";
tc1.Width = "4";
DropDownList ddlItem = new DropDownList();
ddlItem.Width = System.Web.UI.WebControls.Unit.Pixel(109);
ddlItem.Items.Add("--Select--");
tc1.Controls.Add(ddlItem);
tr1.Cells.Add(tc1);
}
if (i == 1)
{
tc1.Height = "21";
tc1.Width = "3";
tr1.Cells.Add(tc1);
}
if (i == 2)
{
TextBox txtDescription = new TextBox();
txtDescription.Width = System.Web.UI.WebControls.Unit.Pixel(150);
txtDescription.Height = System.Web.UI.WebControls.Unit.Pixel(26);
tc1.Controls.Add(txtDescription);
tr1.Cells.Add(tc1);
}
if (i == 3)
{
TextBox txtQty = new TextBox();
txtQty.Width = System.Web.UI.WebControls.Unit.Pixel(60);
txtQty.Height = System.Web.UI.WebControls.Unit.Pixel(26);
tc1.Controls.Add(txtQty);
tr1.Cells.Add(tc1);
}
if (i == 4)
{
TextBox txtPOPrice = new TextBox();
txtPOPrice.Width = System.Web.UI.WebControls.Unit.Pixel(70);
txtPOPrice.Height = System.Web.UI.WebControls.Unit.Pixel(26);
tc1.Controls.Add(txtPOPrice);
tr1.Cells.Add(tc1);
}
else if (i == 5)
{
TextBox txtPartNo = new TextBox();
txtPartNo.Width = System.Web.UI.WebControls.Unit.Pixel(70);
txtPartNo.Height = System.Web.UI.WebControls.Unit.Pixel(26);
tc1.Controls.Add(txtPartNo);
tr1.Cells.Add(tc1);
}
else if (i == 6)
{
TextBox txtRemarks = new TextBox();
txtRemarks.Width = System.Web.UI.WebControls.Unit.Pixel(136);
txtRemarks.Height = System.Web.UI.WebControls.Unit.Pixel(27);
txtRemarks.TextMode =System.Web.UI.WebControls.TextBoxMode.MultiLine;
tc1.Controls.Add(txtRemarks);
tr1.Cells.Add(tc1);
}
else if (i == 7)
{
TextBox txtORC = new TextBox();
txtORC.Width = System.Web.UI.WebControls.Unit.Pixel(67);
txtORC.Height = System.Web.UI.WebControls.Unit.Pixel(26);
tc1.Controls.Add(txtORC);
tr1.Cells.Add(tc1);
}
else if (i == 8)
{
TextBox txtTotal = new TextBox();
txtTotal.Width = System.Web.UI.WebControls.Unit.Pixel(59);
txtTotal.Height = System.Web.UI.WebControls.Unit.Pixel(26);
tc1.Controls.Add(txtTotal);
tr1.Cells.Add(tc1);
}
}
purchaseDetails.Rows.Add(tr1);
}
but it crates only one row .
|
|
|
|
|
HI,
We have an application(HealthCare Domain -- WebApplication) developed using asp.net 1.1 & SQLserver 2000
It's developed and hosted at client places ....Know the hosptal people want the Application be compatable with
TabletPC and requesting the features like they want to write using the pen in the textboxes(Editable fields)
which were located on the application....!
Is the Technologies which we have used are compatable with the TabletPC??
I have searched for the HandWriting Recognition tool...
i found some applications[all are Windows Based applications -- using INKRecognition]
IS it allowed to use Microsoft.INk dll in WebApps??
Could you please suggest me the better approch.....
Thanks
Yuva
|
|
|
|
|
It's not really possible, because ASP.NET doesn't work that way. On the client side, it's just HTML and javascript.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi friends
I have a special requirement to develope a .dll component by which i can send the formatted, templated emails, with attachements,and plain text. it should not depend on any database, very generic one, everything should be configurable through web.config file or xml file.
The template should be formatted like:
Dear {0}
You have successfully registered with{1}
bla bla..
{0} should be replaced with name like "Pradeep" at runtime, and {1} should be with "Collaber" ... these values should be passed at runtime.
i should be able to pass n number of parameters at runtime into template.
Please provide a solution with some samples, its a bit urgent.
Pradeep
Collabera solutions pvt ltd
Bangalore
India
|
|
|
|
|
This is really easy. If you use the {0} {1} type format, you can use the string format method to build your email from the template. The rest is incredibly easy. Just one caveat, the email classes provided in .NET do not close the files used for attachments, so you need to handle the mail sent event, and in there, call close on all the file handles in the attachments collection. I keep meaning to write an article on all the poorly written MS classes....
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all...
Can u guys help me in how to sort the charecters (Alphabetical sorting)in grid view?
My problem is i took a label and a textbox.As soon as i type in a letter in a text box the names starting with that letter should be displayed in the Gridview from the corresponding table in the back end.....
Plz help me out its top urgent....!!!
Thanks
Regards
Abhishek
|
|
|
|
|
Member 4648491 wrote: Plz help me out its top urgent....!!!
Top urgent ? Not just urgent ? Let me drop everyting...
There are AJAX controls that do this. For it to do what you want 'as soon as i type', AJAX is the only solution.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I want a sample code to show a loading page between search page and search result page. But the problem is the code without using ajax and threading. The loading page should be displayed and disabled exactly after the data are loaded into the datagrid in the search result page. Please help me
If you don't understand please refer the following link below and make a hotel search then you can see a loading page.
URL:"http://www.lastminute.com/site/travel/hotels/"
Take a look on this...
Advance Thanks for your help
Gopinath.R
|
|
|
|
|
You have been asking this for days. You have been given your answer. If you can't work it out, then let your client know that you don't have the ability to do this task. There's really nothing more to tell you. The only other option I can see is if you're able to resize or hide an iFrame in javascript. One way or the other, you're going to need to use javascript in order to show a page while another page is loading.
If you look at the source of that page, it looks to me like it's using AJAX and a floating DIV to show the about page.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Adding to CG's post--If you look at "ASP.NET problem design solution" book by Marc Bellinaso, you will find a similar kind of implementation which he has used to send newsletters to millions of user. You can implement the same here too.
|
|
|
|
|
hello frnds,
i am developeing a web site i want to validate a textbox accepting DATE in mmddyyyy format
which validation control should i use ??? and how to validate it ????
thankx in advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
A regex validator seems the most likely candidate to me.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Use RegularExpression validator
|
|
|
|
|
Thankx Guys...
any example of RegX to validate the date in mmddyyyy format ???
thankx in advance
regards
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
I recommend downloading Expresso, which both will have examples, and will help you learn to build your own
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thankx much
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Hi all, im having a little problem here
I started using ASP Membership (Default configuration and no Membership section in my web config), as you know, by default it uses the ApplicationName of "/"
I would like to change the ApplicationName to another name
I changed the ApplicationName in Web config and the aspnet_Applications table fields (ApplicationName and LoweredApplicationName)
I am able to log in with userX, however no roles are assigned to the user after log in. UserX has 3 roles assigned and i made sure by checking the aspnet_UsersInRoles
I check the aspnet_roles table and made sure that the ApplicationID is the same as the ApplicationID in aspnet_Applications and it is the same
When using the ASP web app configuration tool i can see that there are 3 users created but 0 roles created, if i add another role (using this tool) it creates it but also creates another Application record with the default name of "/" and asigns the new role to this new ApplicationID
Is there something else that i should change?
Thanks in advance
Alexei Rodriguez
modified on Monday, February 25, 2008 9:10 PM
|
|
|
|
|
Never mind
The problem was that i hadnt specified a RoleManagerProvider in my webconfig, so the default ("/") was being used, i just included this in my webconfig:
<br />
<roleManager enabled="true"><br />
<providers><br />
<remove name="AspNetSqlRoleProvider" /><br />
<add<br />
connectionStringName="LocalSqlServer" <br />
applicationName="AppName"<br />
name="AspNetSqlRoleProvider" <br />
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /><br />
</providers><br />
</roleManager><br />
Alexei Rodriguez
modified on Thursday, April 10, 2008 7:16 PM
|
|
|
|
|
Hi All,
I am facing some problem in passing tweo parameters using Eval in GridView.
I tried like this, but there is some javascript error-
<asp:hyperlink id="HyperLink2" runat="server" navigateurl="">]]>'
Text= '<%# Bind("AcceptNumber") %>'>
//the javascript function--
function OpenDialog(rid,AcceptNumber) {
window.showModalDialog( "PopupAccept.aspx?ReturnList?ReportNumber= "+ rid+ "&AcceptNumber="+ AcceptNumber+ " ',window, 'dialogWidth:800px;pxcenter:yes;help:no;resizable:no;status:no ")
}
when i click on hyperlink in GridView, it shows some havascript error.
this error says that the second parameter i passed , is not identified.
can anybody tell me how to pass two parameters in a javascript function using Eval.
Please help me.
|
|
|
|
|
I miss an ; at the end of your :
window.showModalDialog( "PopupAccept.aspx?ReturnList?ReportNumber= "+ rid+ "&AcceptNumber="+ AcceptNumber+ " ',window, 'dialogWidth:800px;pxcenter:yes;help:no;resizable:no;status:no ")
Another way is to fill 2 hidden fields within this page through your JS.
After filling these hidden fields do a __Postback(...... (search for __Postback).
Your page will reload and in your codebehind (.aspx.cs file) you can check if the hiddenfields have a value.
|
|
|
|
|
|
I am trying to write a web application using Visual Web Developer 2008 Express edition that uses Virtual Earth and I'm stuck on how to call a certain function from an asp:button event handler.
I'm using the code-behind structure for my webpage. I have one file, cogenmap.aspx, that contains the html for the webpage, and another file, cogenmap.aspx.vb, that contains the Visual Basic code for the webpage.
in my cogenmap.aspx file I have the button declared as follows:
<asp:Button ID="buttonAddUnit" runat="server" Text="Add Unit" />
and in my cogenmap.aspx.vb file I have the event handler written as follows:
Partial Class CogenMap
Inherits System.Web.UI.Page
Protected Sub buttonAddUnit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles buttonAddUnit.Click
Try
'Dim newCoordinates As New VELatLong(CDec(textLatitude.Text), CDec(textLongitude.Text))
Catch ex As Exception
End Try
End Sub
End Class
textLatitude and textLongitude are asp:textbox components and I can reference them with no problems.
The problem is that it can't find the VELatLong function in this context. In the cogenmap.aspx file the line:
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6"></script>
allows me to use the VELatLong function with no problem from a client side script block in the cogenmap.aspx file. But I don't know how to reference it from the cogenmap.aspx.vb file, using VB code instead of ECMAScript.
How can I control my Virtual Earth map display from other ASP.NET controls I have placed on the page, such as this button?
|
|
|
|
|
rushinge wrote: using VB code instead of ECMAScript.
You should use javascript in your pages so that they run on browsers that are not IE. You cannot call this from the code behind, you need instead to create a normal HTML button that calls a javascript method which does what you want on the client side.
I recommend reading a book on ASP.NET so that you understand the difference between the client and the server, this is why you can't call a client method on the server side, and it's really fundamental to you understanding ASP.NET.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|