|
If you create controls dynamically, you have to recreate them on every postback.
If you create the second button in the click event of the first button, it will only be created on the first postback. When you click the second button it will not be recreated, so there won't be any control to handle the click event.
If the controls that you want to create are limited in number, it's easier to create them from the start as invisible controls. Then you can just make them visible to have them rendered in the page.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
I want to get the default printer name of clinet machine to send the crystal report printout from the client machine. How can I do this. in asp.net c#
|
|
|
|
|
You can't.
To get that kind of information you would need to run a component in the browser, like a Java applet or an ActiveX component.
I'm not sure how you think that the information would help you anyway, as you can't use a printer connected to the client computer from the server code.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi , all i have a textbox inside a user control named myusercontrl. so how can i find this textbox and check if it is empty or not using javascript
|
|
|
|
|
You can access text box as follows in javascript:
document.getElementById('<% Response.Write(TextBox1.ClientID); %>').value = "";
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
Hi, I'm new in asp.net and want to Authenticate against a sql server user store. I don't know how to find who is using my page at anytime and don't know how to Authenticate using the sql server user store.
Is there any code sample for that? I kept on google-ing and didn't get anywhere.
Thanks for your help in advance
|
|
|
|
|
Check this [^] and this[^] MSDN article
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
|
Did you try to call chosen masterpage in Page_Load event?
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.
|
|
|
|
|
yup..nothing...it has to be in or before PreInit event
|
|
|
|
|
call Master-Page on Init
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
Hi
I have a gridview with several column.in itemtemplate of this gridview i put a button.one of column is product_id and one of them is a textbox that user input something in it. when user click on button in a row ,how can i get the product_id text and text of that textbox of that row.because i want to remove these values from a list.(I want to get text of that cell)
in which event?
please help me .thanks
|
|
|
|
|
hi,
first u have to find the child control from the grid like this
foreach (GridViewRow gv in <id of="" the="" grid="">.Rows)
{
//fetch the prodid
TextBox txtprodid = (TextBox)gv.findcontrol("mention the product id");
string prodid = txtprodid.Text;
//fetch textbox value
TextBox txt = (TextBox)gv.findcontrol("mention the tetxbox id");
string txtid = txt.Text;
}
T.Balaji
|
|
|
|
|
|
Post your code here to see where is problem.
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.
|
|
|
|
|
Set Previous query string value to null.When u don't need any more.
Request.QueryString["previous"]=null;
Then use condition
if(Request.QueryString["previous"] != null)
{
//your logic here
}
Cheers,
sekhar
|
|
|
|
|
sekhar.k wrote: Request.QueryString["previous"]=null;
The QueryString collection is read-only. You can't change the values.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi all,
My gridview has some data which i want to spool in excel. For that i wrote a code in a button click event like this
protected void imbtnexcel_Click()
{
Response.ContentType = "application/vnd.ms-Excel";
Response.AddHeader("Content-Disposition", "inline;filename=ExcelRPT.xls");
}
im using VS2008.whereas this is working in VS2005
Here the event is getting fired but excel file is not opening.How to acheive this?
T.Balaji
|
|
|
|
|
Hi,
I want to update a server by inserting DropDownList id number into server. could you Please help me with a sample code how to approch that?
thanks in advance,
Pantea
|
|
|
|
|
Hi,
I have a asp.net web page and want to get user's name as soon as the the page get load. is there any easy way to do that? is there any java or C# script for it?
thank for any help in advance
Pantea
|
|
|
|
|
Check this link[^]
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.
|
|
|
|
|
Thanks, but how can I use it for Authentication with usernames I have in mysql. In fact I want to get user's name from window, then check it with the names I have.
Is there any easy way to do that?
Will appreciate any suggestion since I’m new in this field.
Thanks in advance
|
|
|
|
|
Do you have to compare username which operator write on control (in TextBox) with username which have to exists in MySQL database? If yes then make a select statement.
select username from userstable where username='usernameGivedOnTextBox'
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.
|
|
|
|
|
thank you, but i have to somehow get username from window automaticaly and then compare it with the SQL one and if the user's name is in the sql then the user can view the page.
thank you for any help.
|
|
|
|
|
hi all,
may i validate user entries against database column defined size for suppose i have a textbox where i have to enter Username and its size is varchar(20) if it exceeds then display error message that u are excedding then the defined size .
i have 23 server controls on page and i want to validate enteries against database column size which method would be great to use either i use java script or i have to use server side code .
Any help or article wheich will guide me .
thanks in advance
Rameez
|
|
|
|