|
reogeo2008 wrote: I need c# code
We are not code sellers. You should learn to be polite[^]
You can check WebClient class which can upload files to FTP.
|
|
|
|
|
I write this code for showing totalprice in a gridview footer.when this page loaded user input his quantity on textboxes and press a button,after that must see the total price in gridview footer.here is my click event code:(but when I input something in m textboxes and press the button the total price in footer is 0)I used breakpoint and saw the qty is "".how should I correct my code?
protected void Button1_Click(object sender, EventArgs e)
{
if (GridView1.Rows.Count > 0)
{
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
TextBox qty = (TextBox)GridView1.Rows[i].FindControl("textbox2");
Label pr = (Label)GridView1.Rows[i].FindControl("label3");
float total = 0;
if (!string.IsNullOrEmpty(qty.Text))
{
float qty1 = float.Parse(qty.Text);
float pr1 = float.Parse(pr.Text);
total = total + (qty1 * pr1);
}
Label t = (Label)GridView1.FooterRow.FindControl("label3");
t.Text = total.ToString();
}
}
|
|
|
|
|
Are you sure that exists control with name textbox2 in every row of gridview?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
yes it is textbox2.i am sure.
|
|
|
|
|
Did you try to specify cell,like this
<br />
TextBox qty = (TextBox)GridView1.Rows[i].Cells[1].FindControl("textbox2");
Instead index 1 of cell,set cell index which have value of textbox2.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
modified on Thursday, September 4, 2008 7:50 PM
|
|
|
|
|
i try the code like you,but i get the same result,(qty is " ")
where is my problem?
|
|
|
|
|
Is textbox2 within template item?
Does textbox2 have values after Gridview1 is populated with data?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
it is in template item.I couldn't understand your meaning in question 2?
I used breakpoint but in qty is " ",and the data I intered in textbox wasn't there.
|
|
|
|
|
I have make a sample based on your code:
<br />
string[] values ={"zero", "one", "two", "three" ,"four"};<br />
GridView1.DataSource = values;<br />
GridView1.DataBind();<br />
<br />
<br />
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)<br />
{<br />
TextBox qty = (TextBox)GridView1.Rows[i].FindControl("Textbox1");<br />
qty.Text = i.ToString();<br />
}<br />
<br />
string resultvalues = "";<br />
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)<br />
{<br />
TextBox qty = (TextBox)GridView1.Rows[i].FindControl("Textbox1");<br />
resultvalues += qty.Text + ";";<br />
}
and result of variable resultvalues is:0;1;2;3;4;
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hello
i am programin asp net from 1 years
in this moment i am developer in poo an how applied pattern design and practices
i am trying to understand and learn how design without programming
some book than can help me understad how work with this point
when you design you can drawin evertyng witout know the process
regards
|
|
|
|
|
Thanks
but i find articles with search design
thanks
|
|
|
|
|
raquidd22 wrote: n this moment i am developer in poo an how applied pattern design and practices
best_typo_evar!
|
|
|
|
|
Hi,
how to call a webservice running in the local host using ajaxtoolkit AutoCompleteExtender.
I tried adding reference to the asp.net application, but when tried to set ServicePath all i'm able see was disco, discomap and wsdl files only.
I'm using ajaxtoolkit 2.0 and my IDE is VS 2005, framework 2.0
Can any one preach me on this.
Thanks and Rgds,
S
Long Live
|
|
|
|
|
pls help me retrict multiple logon to application with single user account.
somebody helped me to get through it but need some clarification.
To identify browser close event.
if user logs in and leave behind.
|
|
|
|
|
Hi,
Add the login userID's to a "loggedin" database table,
and check whether the current userID used to login
exists in the table.
For that to work, however, you need to insure that users
are recorded as logged out when they exit the application.
You can do that by checking if their sessions have expired,
and deleting the userID record from the table.
Linking the SessionID to the userID should be enough.
I hope this would be helpful.
John Adams
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
hello friends
Now i work in a form that iwant to need a help from u.
how to insert more than one value from checkboxlist in a form
the value is in integer
I was done to store in varchar
for example:
string t;
foreach(listitem li in check.items)
{
if(li.selected)
{
t+=",";
}
t+=li.value;
}
now i inserted t it will be stored in varchar
when i give integer it was to be stored only one value from the checkboxlist.
so i want to insert more than one value from the checkboxlist as integer value
so please help me
avinesh
junior s/w developer
viswam infotech
|
|
|
|
|
I have to give option to include youtube videos into my website.How can i do this?
|
|
|
|
|
Like This[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
reminston wrote: chris r u asking me
We are simply proud of you.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i'm vb.net developer but don't have any idea about asp.net can any of you help by giving source code and guide me
thanx in advance
|
|
|
|
|
reminston wrote: i'm vb.net developer but don't have any idea about asp.net
I am a Horse Rider but don't have an idea weather horse is a machine or furniture
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
We cant give you source code but we can advise you to start with a beginner article of how asp.net works. Why not try out Google, lots of articles there.
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
currently i m using asp.net with c# (.net 2005, 2.0 framework)
where can i find the visual studio .net command prompt?
i execute the following line in my command prompt
%comspec% /k "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
The message displayed that it has executed. but after that what can i do? i would like to open visual studio .net command prompt and work on it? how to proceed? guide me..
thanks in advance - KARAN
|
|
|
|