|
I have one textbox and one button when i click the button i want to set focus to the textbox.how can i do this?
E-Ramu
|
|
|
|
|
Hey.. Itz really a very simple one..
OnClick event of Button, use TextBoxID.Focus()
Regards,
Jay
|
|
|
|
|
Create a global function in a module named
Public Function SetFocus(ByVal FocusControl As Control) As String<br />
'Setting focus to supplied control<br />
Dim Script As New System.Text.StringBuilder<br />
Dim ClientID As String = FocusControl.ClientID<br />
<br />
'Building java script<br />
With Script<br />
.Append("<script language='javascript'>")<br />
.Append("document.getElementById('")<br />
.Append(ClientID)<br />
.Append("').focus();")<br />
.Append("</script>")<br />
End With<br />
<br />
Return Script.ToString()<br />
End Function
Now in button click event add:
RegisterStartupScript("setFocus", Utilities.SetFocus(YOUR TEXTBOX))
==postmaster
http://www.programmingknowledge.com/[^]
|
|
|
|
|
hi
i have an <asp:textbox> i want to validate it for character only,and generating alerts in java script,restrict user to enter only character how can i do this,and also want to validate dropdown and generate alerts select value
thanks
prabhakar dwivedi
|
|
|
|
|
You need to write a javascript function and need to call that onclick of the button. You can attach that javascript through attributes.add funtion of the button.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi, good day.
I have datagrid in my project page, i use the dataset to bind my datagrid from the database. The datagrid have an edit button to let user edit the data in it. My problem is i don't want update the edit data back to my database. I know a solution is to store the edit data in dataset.
But how to edit the data in the dataset and then update back to dataset? After edit/update the datagrid should be bind with the edited dataset, but how to write the code? I really no idea how to write it, can anyone help me to solve the problem? Thanks.... : )
Best Regards,
Pei Sun
|
|
|
|
|
You may refer the 'DataTable' in your DataSet. In that 'DataTable', you may edit the data whatever u want, by using 'DataRow'.
Note that you can refer each value in the DataRow using its Index. For example row["Title"].
Hope it ll help u.
Regards,
Jay
|
|
|
|
|
Hi, thanks for reply.
How to refer data table in dataset? After edit the data in data table, do we need to update it back to dataset?
Can you give me more guidelines? Thanks.
Best Regards,
Pei Sun
|
|
|
|
|
ds.Tables[x]
'x' may be the index or Name of DataTable.
u may first create a DataTable, and assign ur dataset values there like,
DataTable dt=ds.Tables[x]
Also u may keep that 'dt' in ur session, so that the edited values needs to be stored (bcoz u dont want to update in ur database).
-- modified at 1:26 Wednesday 23rd August, 2006
Regards,
Jay
|
|
|
|
|
How do u code switching from one webform to another?
thank you
Nothing lasts but nothing is lost
|
|
|
|
|
Response.Redirect("newForm.aspx");
|
|
|
|
|
thanks bro
Nothing lasts but nothing is lost
|
|
|
|
|
it doesnt work, it gives an error
something about the server
Nothing lasts but nothing is lost
|
|
|
|
|
Solly74 wrote: it doesnt work, it gives an error
something about the server
Okay... I'm not sure what to do with that reply. You'll agree, you've given very little information for me to go on, yes? Unless you wish to elaborate, I've got nothing more to add to help you.
|
|
|
|
|
I'll agree that your request is very sparse in useful details. However, I would imagine your problem be be solved this way
Response.Redirect("MyPage.aspx", false);
The second paramater tells the server whether it should stop the execution of the current page. Another way would be using
Server.Transfer("MyPage.aspx", true);
only two letters away from being an asset
|
|
|
|
|
Hi
i want to make a web site that the user can choose between diffrent web designs at the run time.
i have 4 web designs that are completly diffrent.
ex) places of the Menu and controls in each design is diffrent.
can i support such a functionality using the Themes and Skin ?
and if not does any body has an idea how can i implement this function.
|
|
|
|
|
|
Ok I have got my page to display the data I need using a store procedure etc. What I need to know is, how do I create an input text form box (IE: Enter ID here with a submit button and pass that variable to the (ident = 1) below to make it (ident = textboxvariable). Any help would be appreciated thanks! =)
<%Dim ident
'select your product_id
ident = 1
Dim connection
Dim rs
'create the connection
connection = Server.CreateObject("adodb.connection")
'create the connection (here we used a DSN - use any standard connection
connection.open("Driver={SQL Server};Server=X;Database=trd;Uid=X;Pwd=X;")
'create the recordset
rs = Server.CreateObject("adodb.recordset")
'open the recordset, passing in the variable
'note that the variable product_id does not have to be name the same as in the stored procedure, it just needs to be the same data type.
rs.Open("Exec GETID " & ident, connection)
'display the recordset
Do Until rs.EOF
For Each ident In rs.Fields
Response.Write(ident.value & "<br />")
Next
Response.Write("<br />")
rs.MoveNext()
Loop
rs.close()
connection.close()%>
Jesse Myer
jessemyer06@aol.com
-- modified at 16:25 Tuesday 22nd August, 2006
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
I still need help with this problem, and I posted it in both ASP.NET (as it is an ASP page) and Web Development forums.
|
|
|
|
|
You should only post it in the most relevant forum. If you think that you need to draw attention to it from other forums, post a message with a link to the real thread.
Everything posted in the ASP.NET forum is related to web development, as ASP.NET is a platform for developing web sites. Everything is also reated to .NET Framework. Almost everything is also related either to C# or VB. A lot of it is also related to SQL. If everyone would post every question in every related forum, the forums would end up containing the same questions, and there would be no reason to have separate forums at all.
---
b { font-weight: normal; }
|
|
|
|
|
Using C#, I have a gridview where I populate the database from the database.
The gridview will display many records. I wish to include a textbox for user to enter the admin number he/she wish to find. And a button for the user to click. The gridview will then filter and show the rows of records of that admin number.
How should I work around with it? Should I control the gridview by the textbox or button?
thanks in advance. Much appreciated.
|
|
|
|
|
Hi there,
IMO, the simple way is to repopulate the datasource and bind it to the gridview control to display the search result. Adn you can do in the common way that many other sites do with a textbox for inputting and a button/imagebutton to execute the search.
|
|
|
|
|
minhpc_bk wrote: And you can do in the common way that many other sites do
Yes I was thinking to do the same thing. But I was wondering how they do it?
Is there any sample link?
thanks in advance. Much appreciated.
|
|
|
|
|
blurMember wrote: But I was wondering how they do it?
Is there any sample link?
It's not difficult, you can get started with the Starter kits[^]
|
|
|
|