|
hi all,
i have dropdownlist with values from 1 to 10 and text box where user enters the task details what i have to do i have made auto increament in Dropdownlist value when user submits the task .
for suppose after submitting task one Dropdownlist item get auto increament to next number .
which appraoch would be good ?
Any idea ?
best Regards
Rameez
|
|
|
|
|
<br />
DropDownList1.Items.Add(new ListItem(Convert.ToString(DropDownList1.Items.Count + 1), Convert.ToString(DropDownList1.Items.Count + 1)));
If you have to bind dropdownlist from database then bind it after you add new task.
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.
|
|
|
|
|
So, from what I can find (and there is very little on the subject that I can locate) this control cannot be used to interface with a regular database like the login control can be. It seems to be hard wired to want\need to use the Membership system that is part of ASP.NET .
Is this true? Can anyone either conform or deny this? If I CAN use it with a regular old Access database someone please please please point me in the direction of some decent docs on the subject.
Thanks!
Oh, and before anyone comes back to me about using Access, please don't It's not my fault I am being made to use this poor excuse for a database engine to back an ASP.NET web site.
|
|
|
|
|
Good Evening Guys, Today its my Birthaday.
I have a If statement that i use to return an integer that will mean Success or Failure , now am testing for that integer in my ASP.NET 2.0 Page lke this
if (Res == 1)
{
Response.Write(@"<script> alert('You have Successfully Registred');</script>");
Response.Redirect("login.aspx", false);
}
else
{
Response.Write(@"<script> alert('Invalid Data has been Entered');</script>");
Now if the value is 1, then it should Display the Message and after the Message has been Clicked it should move to the login Page. Now my Problem is that it moves to the Login Page without a Alert Message being Displayed And the send Alert for invalid Entry, will not show anythingm, there is a Warning sign on my Page at the Bootom left of my Page. What is wrong with my Javascript
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You can not send two responses to one request, so you can't both have a page containing the Javascript and a page for the redirect. When you do the redirect the current page (where you added the script) is scrapped, and a redirect page is sent instead. So the reason that the alert doesn't show up is that you removed it.
You either have to make the login page show the alert, or do the redirect using Javascript.
When you get a warning sign at the bottom of the page, there is an error message. Double click the warning sign to display the error message.
It's probably because you put the script in the wrong place in the page. You should not use Response.Write at all, unless you take over the responsability for the page completely and write out the entire page with Response.Write. If you use Response.Write to put the script in the page, you will write it before the actual html document, which will keep it from working properly.
Use the ClientScript.RegisterStartupScript method to add scripts to the page.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Page.RegisterStartupScript("hai", "alert('hai')")
the above display alert box
your's subbu
|
|
|
|
|
Thanks it works
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You can do in follwoing way
if (Res == 1)
{
this.ClientScript.RegisterStartupScript(this.GetType(), "key", "myfunction();", true);
)
and in myfunction function just show the alert message and redirect user to Login Page
<script type="text/javascript">
function myfunction()
{
alert('You have Successfully Registred')
window.location.href='Login.aspx';
}
</script>
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
hi
Thank you , its working
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I have a datalist that as two button in item template.i want to when i click on a button get the id of that row.that type of id is char.in witch event I should write this code.
|
|
|
|
|
In the click event for the button ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
ItemCommand . There are more specific event such as UpdateCommand DataList Events[^].
Eslam Afifi
|
|
|
|
|
hello everyone! i've got the following problem.
In web.config i've defined a section
<databaseSettings>
<add key="dataSource" value="someDB.sdf"/>
<add key="password" value="somePass"/>
<add key="connectionString" value="Data Source=<_here_should_be_value_of_dataSource_entry_>;Password=<_and_here_value_of_password_>;"/>
</databaseSettings>
the problem is how values of "dataSource" and "password" entries could be used in "connectionString" (as i've tried to show above). i am using this values in code to manipulate data base file as well as to initiate db connection. thus i need all this entries, and it will be quite handy if any changes in db (e.g. name or pass) will cause changes in only one place in the web.config. can someone help me out with this problem?
thanks
|
|
|
|
|
Hi,
I have an gridview in which I have placed an TEXTBOX.
There are option in the gridview such as accept and reject on both the actions the user will enter some text in the TEXTBOX which will be emailed to the user.
I m doing this on rowcommand event of gridview but I m not able to retrieve the value in the TEXTBOX.
the code is as following
if (e.CommandName == "Accept")
{
int index = Convert.ToInt32(e.CommandArgument);
int id = Convert.ToInt32(GridView1.DataKeys[index].Value);
string tbcomment = ((TextBox)GridView1.Rows[index].FindControl("txtComment")).Text;
TextBox text = (TextBox)GridView1.Rows[index].Cells[8].FindControl("txtId");
Label tb = (Label)GridView1.Rows[index].FindControl("lblId");
Response.Write(tbcomment);
grid_bind();
}
NOT GETTING THE VALUE IN TXTCOMMENT THAT THE USER WILL WRITE.
ANY SUGGESTION?
Vijay V.
Yash Softech
|
|
|
|
|
|
i can send a value to other form with this code:
Response.Redirect("~/Default2.aspx?Mode=" + TextBox1.Text);
but i can not get it in default2.aspx. can any body help me?
|
|
|
|
|
You should get values in the second Page
This Technique is called passing value in QueryString
Make sure that TextBox1.Text is havinf somw value
in 2 page use request object to get the value
this.Request.QueryString["Mode"]
It will return its value
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
You are passing the value by request query string.In default2.aspx you should use
string str=request.querystring["Mode"];
your's subbu
|
|
|
|
|
Hi all,
I have a requirement of converting/exporting the html data of webpage into power point.
i.e, i have a gridview control along with with other asp controls and i have button 'btn_exportToppt', when i click on this button the gridview data should be saved in powerpoint with style shhets like an image.
Please suggest me how to do this..
Thanks in advance,
sekhar
|
|
|
|
|
There is an article in CP at this link[^].
You can take this as a start point.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i also facing same problem .
have yopu any solution for that.
hasan
|
|
|
|
|
Dear All
I am using crystal report in my web application developed in Asp.net 2003 and sql server 2000.Report are working fine in my local PC but when I trying same thing in server then, PDF reports are working fine but excel reports are showing following Error:
"## Error in File C:\WINDOWS\TEMP\temp_b80d89a4-560d-48a4-923d-7f1d541ccf16.rpt:Error detected by export DLL: ##"
Please help me ASAP.
Thanks
With Regards
Vivek
|
|
|
|
|
can any one have any idea is it possible to use values from aspx.cs file(codebehind file) in an aspx file(main asp.net page)
|
|
|
|
|
Those two Files represent one thing. please Explain briefly what you want to achieve
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
just guessing at what you need, but you can embed <%= expr %> tags in the .aspx page, where expr is any public method or expression
for example
<%=CustomerName%>
would be replaced with the value returned by a public property CustomerName
there are other variations on this technique as well; is that what you were looking for?
|
|
|
|