Showing posts with label button. Show all posts
Showing posts with label button. Show all posts

Saturday, March 31, 2012

set absolute position on panel

How can the absolute position be set when a button is hit. I have a help
pannel that i want to appear next to the "?" button that is selected.
thanks
any ideas would be appreciated
kesset
obj.style.top = x;
obj.style.left = y;
to find the x and y of an object:
window.getYPos = function(obj){
var curtop = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curtop += obj.offsetTop;
if (typeof(obj.scrollTop) == 'number')
curtop -= obj.scrollTop;
obj = obj.offsetParent;
}
}
else if (document.layers)
curtop += obj.y;
return curtop;
}
window.getXPos = function(obj) {
var curleft = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (document.layers)
curleft += obj.x;
return curleft;
}
-- bruce (sqlwork.com)
"Kurt Schroeder" <KurtSchroeder@.discussions.microsoft.com> wrote in message
news:522009E3-7335-4B58-A4E9-28F9C49281E1@.microsoft.com...
> How can the absolute position be set when a button is hit. I have a help
> pannel that i want to appear next to the "?" button that is selected.
> thanks
> any ideas would be appreciated
> kes

set absolute position on panel

How can the absolute position be set when a button is hit. I have a help
pannel that i want to appear next to the "?" button that is selected.

thanks
any ideas would be appreciated
kesset
obj.style.top = x;
obj.style.left = y;

to find the x and y of an object:

window.getYPos = function(obj){
var curtop = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curtop += obj.offsetTop;
if (typeof(obj.scrollTop) == 'number')
curtop -= obj.scrollTop;
obj = obj.offsetParent;
}
}
else if (document.layers)
curtop += obj.y;
return curtop;
}
window.getXPos = function(obj) {
var curleft = 0;
if (document.getElementById || document.all) {
while (obj.offsetParent) {
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (document.layers)
curleft += obj.x;
return curleft;
}

-- bruce (sqlwork.com)

"Kurt Schroeder" <KurtSchroeder@.discussions.microsoft.com> wrote in message
news:522009E3-7335-4B58-A4E9-28F9C49281E1@.microsoft.com...
> How can the absolute position be set when a button is hit. I have a help
> pannel that i want to appear next to the "?" button that is selected.
> thanks
> any ideas would be appreciated
> kes

Set browser in PrinPreview state on page load

Hi, Can i set the clients browser programmatically to PrintPreview state (File->Print Preview) when the client clicks the button print?

I don't want to use Crystal nor Report Viewer for some reasons

regards

Thanks in advance! More Power!

Hi,

As far as I know, it's impossible because you have to manipulate IE from client. If so, that means you have access to control windows process, then that's very dangerous. What's more, in fact, there are little APIs for us to control IE's function, especially such thing.

HTH


Hey Dfox,

Unfortunately asp.net works server side, so you can't change client side behaviour.

Keep up the good programming!

Thursday, March 29, 2012

Set Button : autopostback to be false

The standard button is set its autopostback property to be true, am I right
?
How can I change it to be false ?
I tried this...
<td><asp:Button id="cmd1" ... autopostback="false"/></td>
But it failed. Why?
ThxThat's what you get when you use a server-side control - when it's clicked
it will post back to the server. If you don't want a postback then simply
use a <input type=button>.
-Brock
DevelopMentor
http://staff.develop.com/ballen

> The standard button is set its autopostback property to be true, am I
> right
> ?
> How can I change it to be false ?
> I tried this...
> <td><asp:Button id="cmd1" ... autopostback="false"/></td>
> But it failed. Why?
> Thx
>

Set Button : autopostback to be false

The standard button is set its autopostback property to be true, am I right
?
How can I change it to be false ?
I tried this...
<td><asp:Button id="cmd1" ... autopostback="false"/></td>
But it failed. Why?

ThxThat's what you get when you use a server-side control - when it's clicked
it will post back to the server. If you don't want a postback then simply
use a <input type=button>.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> The standard button is set its autopostback property to be true, am I
> right
> ?
> How can I change it to be false ?
> I tried this...
> <td><asp:Button id="cmd1" ... autopostback="false"/></td>
> But it failed. Why?
> Thx

Set datagrid cell enabled to false

When a user hits the edit button, I want to either make a certain cell not enabled, or not visible. I don't care which. I can't seem to get either to work.

Here is my code that I tried:Dim cn As New OleDb.OleDbConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;" _
& "Persist Security Info=False;" _
& "Initial Catalog=fuel info;" _
& "UID=;PWD=;" _
& "Data Source=Server7")
cn.Open()

Dim datAdapt As New OleDb.OleDbDataAdapter("Select Vendor_No as [Vendor No], " & _
"Vendor_Name as [Vendor Name], Vendor_Terminal as [Vendor Terminal], " & _
"Vendor_Trmnl_No As [Terminal No], Vendor_City As [City], Vendor_State As " & _
"[State], ID From Other_Vendors Order By Vendor_Name", cn)

Dim datSet As New Data.DataSet

datAdapt.Fill(datSet, "Other_Vendors")

DataGrid1.DataSource = datSet
DataGrid1.DataKeyField = "ID"
DataGrid1.EditItemIndex = e.Item.ItemIndex
e.Item.Cells(3).Enabled = False
DataGrid1.DataBind()
cn.Close()
cn.Dispose()
datAdapt.Dispose()
datSet.Dispose()
As you can see, the line that is not working is "e.item.cells(3).enabled = false"

Also, if anyone knows how to set the width of the cell on the fly as well, I would appreciate that as well.

ThanksTry looking into the ItemDataBound sub and adding

e.Item.Cells(3).Enabled = False

in there. You cant disable the cells before the data is in them. RIght now you are trying to disable that cell before the data has been bound to the grid.

Jerel
Phelnglai, that did the trick. One more quick question. Could you set the cell width from the same place? If so, do you know the syntax? Thanks.

What about the cell header? What would the syntax be for that?

Thanks again!
Nevermind, I see that if you just increase the width of the actual datagrid, the fields will increase and adjust on their own at run time.
Glad you got it. Sorry I never answered your second question. I was in a car wreck and am just now getting back to work and doing thinks.

If you have any other questions, feel free to ask.

Jerel

Wednesday, March 28, 2012

Set default button

How can I set a button as default on an aspx page? When the user hits the
Enter button this default button is automtcally clicked.
Thanks,
LouIn ASP.NET 2.0 the panel control has a new DefaultButton property.
Set this property to the ID of a button control and it will be the default
button when focus is in that panel.
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Lou Civitella" <lou@.webersystems.com> wrote in message
news:ucBQh8$PHHA.4492@.TK2MSFTNGP02.phx.gbl...
> How can I set a button as default on an aspx page? When the user hits the
> Enter button this default button is automtcally clicked.
> Thanks,
> Lou
>
Hi,
To your TextBox add a JavaScript event onkeydown using
Attributes.Add().
if pressed key is EnterKey i.e with KeyCode=13 then call the Click()
method of the button(this is the default button)
TextBox1.Attributes.Add("onkeydown", "if(event.keyCode){if
(event.keyCode == 13)
{document.getElementById('"+Button1.UniqueID+"').click();return
false;}} else {return true}; ");
thanks,
aru

Set default button

How can I set a button as default on an aspx page? When the user hits the
Enter button this default button is automtcally clicked.

Thanks,
LouIn ASP.NET 2.0 the panel control has a new DefaultButton property.
Set this property to the ID of a button control and it will be the default
button when focus is in that panel.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Lou Civitella" <lou@.webersystems.comwrote in message
news:ucBQh8$PHHA.4492@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

How can I set a button as default on an aspx page? When the user hits the
Enter button this default button is automtcally clicked.
>
Thanks,
Lou
>


Hi,

To your TextBox add a JavaScript event onkeydown using
Attributes.Add().
if pressed key is EnterKey i.e with KeyCode=13 then call the Click()
method of the button(this is the default button)

TextBox1.Attributes.Add("onkeydown", "if(event.keyCode){if
(event.keyCode == 13)
{document.getElementById('"+Button1.UniqueID+"').click();return
false;}} else {return true}; ");

thanks,
aru

Set default button pressed when the user press the return key

Hi

ive got a textbox and a button on a page. I want it so whenever the user types something in the textbox and then press their return key, the form button gets pressed.

How do i do that? set which button gets pressed when the user press the 'return/enter' key on their keyboard.

how someone can help

thanks

Check out this post for 3 great ways to make a button the default:

http://forums.asp.net/thread/1671669.aspx

Monday, March 26, 2012

Set field to null

I am trying to set a field in a sql server table to null if the user hits a certain button.

How can I set it to DBNull?

I have tried the following but It doesnt work.

Dim updateSOrder As String = "Update SOrders set confirm_id = @dotnet.itags.org.confirmId where SOrder ='" & lblConfirmOrder.Text & "'"

Dim SaveDelete As SqlCommand
SaveDelete = New SqlCommand(updateSOrder, oConnection)

Dim blank As DBNull
SaveDelete.Parameters.Add(New SqlParameter("@dotnet.itags.org.ConfirmId", SqlDbType.NVarChar, 40))
SaveDelete.Parameters("@dotnet.itags.org.ConfirmId").Value = blank

SaveDelete.ExecuteNonQuery()

You may try this:

SaveDelete.Parameters("@.ConfirmId").Value = DBNull.Value

Saturday, March 24, 2012

set focus after cancelling edit in gridview

Hi,
I have a gridview with edit option. If the user chooses to edit the
row and then press the Cancel button - I would like the focus to
return to the chosen row.
Someone has any idea how to implement it?
Thanks.
Regards,
Ruthie.ruthie wrote:
> Hi,
> I have a gridview with edit option. If the user chooses to edit the
> row and then press the Cancel button - I would like the focus to
> return to the chosen row.
> Someone has any idea how to implement it?
What do you mean by focus?
Riki
On Jun 10, 6:32 pm, "Riki" <r...@.dontnagme.com> wrote:
> ruthie wrote:
>
>
> What do you mean by focus?
> --
> Riki
Hi Riki,
Lets say that the user scrolls the gridview page and presses the edit
button and
then he chooses to cancel editing. After he presses the cancel button,
the page is
regenerated and he sees now the beginning of the page - and not the
row which he chose before.
I had the same problem with the edit button - but I managed to solve
it - After the user presses the edit button, there is a
radiobuttonlist in the chosen row
(edit template) - so I use this.setFocus(controlID) - but when
cancelling edit - all the rows are the same and there is no special
row.
Thanks so much.
Ruthie.
Jessica Alba and Sarah M. Gellar Lick Pussies On Sofa!
http://www.reyrewh.com/Player.wmv?q=1673286
Cameron Diaz and Mariah Carey Machine XXXX!
http://www.reyrewh.com/PlayFile?clip=1673286
Shania Twain and Angelina Jolie , Weird Lesbian Sex Act!
http://www.reyrewh.com/WindowsMedia...mpeg?q=1673286
Halle Berry and Lindsay Lohan Crazy On High Heels!
http://www.reyrewh.com/watch?id=1673286
Cameron Diaz and Christina Aguilera Hardest Lesbians Wrestling Match!
http://www.reyrewh.com/WatchMovie?watch=1673286
japanese sex moviefree sex clipanal pregnant sexadvice card consolidation credit debtlesbian sex site
http://yxss6yjt.t35.com/sex-video/s...-sex-video.htmlhttp://qrioullz.t35.com/adult-sex-t...oy
.htmlhttp://cteud0l4.t35.com/sex-picture...on-a-plane.htmlhttp://slw7p
l0p.t35.com/tee...e-teen-sex.htmlhttp://qrioullz.t35.com/adult-sex-t...me-sex-toy.html

set focus after cancelling edit in gridview

Hi,

I have a gridview with edit option. If the user chooses to edit the
row and then press the Cancel button - I would like the focus to
return to the chosen row.

Someone has any idea how to implement it?

Thanks.
Regards,

Ruthie.ruthie wrote:

Quote:

Originally Posted by

Hi,
>
I have a gridview with edit option. If the user chooses to edit the
row and then press the Cancel button - I would like the focus to
return to the chosen row.
>
Someone has any idea how to implement it?


What do you mean by focus?

--

Riki
On Jun 10, 6:32 pm, "Riki" <r...@.dontnagme.comwrote:

Quote:

Originally Posted by

ruthie wrote:

Quote:

Originally Posted by

Hi,


>

Quote:

Originally Posted by

I have a gridview with edit option. If the user chooses to edit the
row and then press the Cancel button - I would like the focus to
return to the chosen row.


>

Quote:

Originally Posted by

Someone has any idea how to implement it?


>
What do you mean by focus?
>
--
>
Riki


Hi Riki,

Lets say that the user scrolls the gridview page and presses the edit
button and
then he chooses to cancel editing. After he presses the cancel button,
the page is
regenerated and he sees now the beginning of the page - and not the
row which he chose before.
I had the same problem with the edit button - but I managed to solve
it - After the user presses the edit button, there is a
radiobuttonlist in the chosen row
(edit template) - so I use this.setFocus(controlID) - but when
cancelling edit - all the rows are the same and there is no special
row.

Thanks so much.
Ruthie.

set focus on the control

Can I set a specific control on focus? My case is after I click a "Submit" button, I want to set the cursor on a textbox .

Million thanksCheck out this code snippet,
http://www.extremeexperts.com/Net/C...erPostback.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Grey" <ericyum@.i-cable.com> wrote in message news:equliHu5DHA.1504@.TK2MSFTNGP12.phx.gbl...
Can I set a specific control on focus? My case is after I click a "Submit" button, I want to set the cursor on a textbox .

Million thanks
This is the code i use. it takes a control and sets the focus.
public static void SetInitialFocus(System.Web.UI.Control control)

{

if (control.Page == null)

{

throw new ArgumentException(

"The Control must be added to a Page before you can set the IntialFocus to it.");

}

if (control.Page.Request.Browser.JavaScript == true)

{

// Create JavaScript

System.Text.StringBuilder s = new System.Text.StringBuilder();

s.Append("\n<SCRIPT LANGUAGE='JavaScript'>\n");

s.Append("<!--\n");

s.Append("function SetInitialFocus()\n");

s.Append("{\n");

s.Append(" document.");

// Find the Form

System.Web.UI.Control p = control.Parent;

while (!(p is System.Web.UI.HtmlControls.HtmlForm))

p = p.Parent;

s.Append(p.ClientID);

s.Append("['");

s.Append(control.UniqueID);

// Set Focus on the selected item of a RadioButtonList

System.Web.UI.WebControls.TextBox rbl = control as System.Web.UI.WebControls.TextBox;

s.Append("'].focus();\n");

s.Append("}\n");

if (control.Page.SmartNavigation)

s.Append("window.setTimeout(SetInitialFocus, 500);\n");

else

s.Append("window.onload = SetInitialFocus;\n");

s.Append("// -->\n");

s.Append("</SCRIPT>");

// Register Client Script

control.Page.RegisterClientScriptBlock("InitialFocus", s.ToString());

}

}

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Grey" <ericyum@.i-cable.com> wrote in message news:equliHu5DHA.1504@.TK2MSFTNGP12.phx.gbl...
Can I set a specific control on focus? My case is after I click a "Submit" button, I want to set the cursor on a textbox .

Million thanks
In code-behind file, register JavaScript code to handle client onclick method of submit button:

e.g. btnSubmit.Attributes.Add("onclick", "OnSubmitTest");

in .aspx file, add following JavaScript method:

function OnSubmitTest()
{
if (null != document.all("txtTextbox"))
document.all("txtTextbox").focus();
}

Tiendq,
tien@.tienonsoftware.com
"Grey" <ericyum@.i-cable.com> wrote in message news:equliHu5DHA.1504@.TK2MSFTNGP12.phx.gbl...
Can I set a specific control on focus? My case is after I click a "Submit" button, I want to set the cursor on a textbox .

Million thanks

set focus to form after postback

Hi.

I have one datalist and i have done custom paging for it.

I have four link button "First","Previous","Next", "Last" for paging datalist

Now I want to do paging on key press like as Right arrow for Next,Left Arrow for Previous,..........

for that I am calling javascript on onkeypress event of form.

Now Its working fine but problem is that javascript is called only on form key press event.

so that I want to set out focus on form after every post back.

I am calling following line at last but not working.

this.form1.Focus();

plz any one can help me?

best regard

pathan

Try this Just a guess

<formdefaultfocus="form1"id="form1"runat="server">


not helpful

set focus to textbox after click event- tried everything please please help!

Hello-
I have a form which has a listbox, a textbox and a submit button. The
user types a phone number into the textbox, clicks button, text gets
added to the listbox. After this process I need the focus to be back
in the textbox. Sounds easy hu?
Here's my code-

Private Sub cmdAddLine_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAddLine.Click

lstLines.Items.Add(PhoneFormat(txtAddLine.Text))
txtAddLine.Text = ""
setFocus(txtAddLine)

End Sub

Public Sub setFocus(ByVal ctrl As System.Web.UI.Control)

Dim strS As String
strS = "<SCRIPT language='javascript'>document.getElementById('" +
ctrl.ID + "').focus();</SCRIPT>"
RegisterStartupScript("focus", strS)

End Sub

This will not place the focus in the textbox. What am I missing?

Again, PLEASE help. Thanks much!On 7 Jul 2004 10:42:20 -0700, JC <ujjc001@.charter.net> wrote:

> Hello-
> I have a form which has a listbox, a textbox and a submit button. The
> user types a phone number into the textbox, clicks button, text gets
> added to the listbox. After this process I need the focus to be back
> in the textbox. Sounds easy hu?
> Here's my code-
> Private Sub cmdAddLine_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles cmdAddLine.Click
> lstLines.Items.Add(PhoneFormat(txtAddLine.Text))
> txtAddLine.Text = ""
> setFocus(txtAddLine)
> End Sub
> Public Sub setFocus(ByVal ctrl As System.Web.UI.Control)
> Dim strS As String
> strS = "<SCRIPT language='javascript'>document.getElementById('" +
> ctrl.ID + "').focus();</SCRIPT>"
> RegisterStartupScript("focus", strS)
> End Sub
> This will not place the focus in the textbox. What am I missing?
> Again, PLEASE help. Thanks much!

Do you get a JS error? I assume you are; your control will get a unique
client ID that .NET creates on the actual HTML, so you can't just look for
ctrl.ID. Try ctrl.ClientID

http://msdn.microsoft.com/library/e...rmscontrols.asp

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
gah, dang sig...ignore, just testing/updating my sig correctly..

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
On 7 Jul 2004 10:42:20 -0700, ujjc001@.charter.net (JC) wrote:

>Hello-
>I have a form which has a listbox, a textbox and a submit button. The
>user types a phone number into the textbox, clicks button, text gets
>added to the listbox. After this process I need the focus to be back
>in the textbox. Sounds easy hu?
>Here's my code-
>Private Sub cmdAddLine_Click(ByVal sender As System.Object, ByVal e As
>System.EventArgs) Handles cmdAddLine.Click
>lstLines.Items.Add(PhoneFormat(txtAddLine.Text))
>txtAddLine.Text = ""
>setFocus(txtAddLine)
>End Sub
>Public Sub setFocus(ByVal ctrl As System.Web.UI.Control)
>Dim strS As String
>strS = "<SCRIPT language='javascript'>document.getElementById('" +
>ctrl.ID + "').focus();</SCRIPT>"
>RegisterStartupScript("focus", strS)
>End Sub
>This will not place the focus in the textbox. What am I missing?
>Again, PLEASE help. Thanks much!

Put a blank label at the bottom of the form and set its text property
in the codebehind instead of using the registerstartupscript.

-Adam
:o) You're all wrong. I took and made a clean application and it
worked, so I knew it wasn't the code there. I went back to my app,
(made a copy) and proceded to strip everything out until it worked.
Well, after everything was gone it still didn't work. There was only
one remaining thing, smartnavigaion = true.
That fixed the focus problem by turning it off, however it introduced a
whole new set of problems.
Having a database application, the users need to not use the back
button. I've got all the standard code for this but it's still not as
clean as smartnav.
Is there ANY way to overcome smartnav's focus problem?
MICROSOFT??
I didn't think so.
Anyhow, I've solved one problem only to intoduce many more. I may have
more ?'s soon, some really good ones I've been working on. Thanks for
the help so far.
Jeff

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

set focus to textbox after click event- tried everything please please help!

Hello-
I have a form which has a listbox, a textbox and a submit button. The
user types a phone number into the textbox, clicks button, text gets
added to the listbox. After this process I need the focus to be back
in the textbox. Sounds easy hu?
Here's my code-
Private Sub cmdAddLine_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAddLine.Click
lstLines.Items.Add(PhoneFormat(txtAddLine.Text))
txtAddLine.Text = ""
setFocus(txtAddLine)
End Sub
Public Sub setFocus(ByVal ctrl As System.Web.UI.Control)
Dim strS As String
strS = "<SCRIPT language='javascript'>document.getElementById('" +
ctrl.ID + "').focus();</SCRIPT>"
RegisterStartupScript("focus", strS)
End Sub
This will not place the focus in the textbox. What am I missing?
Again, PLEASE help. Thanks much!On 7 Jul 2004 10:42:20 -0700, JC <ujjc001@.charter.net> wrote:

> Hello-
> I have a form which has a listbox, a textbox and a submit button. The
> user types a phone number into the textbox, clicks button, text gets
> added to the listbox. After this process I need the focus to be back
> in the textbox. Sounds easy hu?
> Here's my code-
> Private Sub cmdAddLine_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles cmdAddLine.Click
> lstLines.Items.Add(PhoneFormat(txtAddLine.Text))
> txtAddLine.Text = ""
> setFocus(txtAddLine)
> End Sub
> Public Sub setFocus(ByVal ctrl As System.Web.UI.Control)
> Dim strS As String
> strS = "<SCRIPT language='javascript'>document.getElementById('" +
> ctrl.ID + "').focus();</SCRIPT>"
> RegisterStartupScript("focus", strS)
> End Sub
> This will not place the focus in the textbox. What am I missing?
> Again, PLEASE help. Thanks much!
Do you get a JS error? I assume you are; your control will get a unique
client ID that .NET creates on the actual HTML, so you can't just look for
ctrl.ID. Try ctrl.ClientID
http://msdn.microsoft.com/library/e...br />
rols.asp
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
gah, dang sig...ignore, just testing/updating my sig correctly..
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
On 7 Jul 2004 10:42:20 -0700, ujjc001@.charter.net (JC) wrote:

>Hello-
>I have a form which has a listbox, a textbox and a submit button. The
>user types a phone number into the textbox, clicks button, text gets
>added to the listbox. After this process I need the focus to be back
>in the textbox. Sounds easy hu?
>Here's my code-
>Private Sub cmdAddLine_Click(ByVal sender As System.Object, ByVal e As
>System.EventArgs) Handles cmdAddLine.Click
>lstLines.Items.Add(PhoneFormat(txtAddLine.Text))
>txtAddLine.Text = ""
>setFocus(txtAddLine)
>End Sub
>Public Sub setFocus(ByVal ctrl As System.Web.UI.Control)
>Dim strS As String
>strS = "<SCRIPT language='javascript'>document.getElementById('" +
>ctrl.ID + "').focus();</SCRIPT>"
>RegisterStartupScript("focus", strS)
>End Sub
>This will not place the focus in the textbox. What am I missing?
>Again, PLEASE help. Thanks much!
Put a blank label at the bottom of the form and set its text property
in the codebehind instead of using the registerstartupscript.
-Adam
:o) You're all wrong. I took and made a clean application and it
worked, so I knew it wasn't the code there. I went back to my app,
(made a copy) and proceded to strip everything out until it worked.
Well, after everything was gone it still didn't work. There was only
one remaining thing, smartnavigaion = true.
That fixed the focus problem by turning it off, however it introduced a
whole new set of problems.
Having a database application, the users need to not use the back
button. I've got all the standard code for this but it's still not as
clean as smartnav.
Is there ANY way to overcome smartnav's focus problem?
MICROSOFT'
I didn't think so.
Anyhow, I've solved one problem only to intoduce many more. I may have
more ?'s soon, some really good ones I've been working on. Thanks for
the help so far.
Jeff
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Thursday, March 22, 2012

Set headertext in datagrid programatically

I create a datagrid using the Web Forms Toolbox
The dataadapter,dataset and databind() code runs in a button eventhandler
The headertext is currently determined by the column names of my SQL select
statement there.
How can I change the headertext programatically in the codebehind? ... I do
n't want to change the preexisting code if at all possible.in your itemdatabound event handler, you can test for the headeritem and
then use the text property attached to the cell object to change the text
e.item.cells[4].text = "vapor"
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"mg" <mg@.theworld.com> wrote in message
news:88A2B342-0B07-4CD5-80AC-8C989FE5C2EA@.microsoft.com...
>I create a datagrid using the Web Forms Toolbox
> The dataadapter,dataset and databind() code runs in a button eventhandler
> The headertext is currently determined by the column names of my SQL
> select statement there.
> How can I change the headertext programatically in the codebehind? ... I
> don't want to change the preexisting code if at all possible.

Set headertext in datagrid programatically

I create a datagrid using the Web Forms Toolbo

The dataadapter,dataset and databind() code runs in a button eventhandler

The headertext is currently determined by the column names of my SQL select statement there

How can I change the headertext programatically in the codebehind? ... I don't want to change the preexisting code if at all possible.in your itemdatabound event handler, you can test for the headeritem and
then use the text property attached to the cell object to change the text
e.item.cells[4].text = "vapor"

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"mg" <mg@.theworld.com> wrote in message
news:88A2B342-0B07-4CD5-80AC-8C989FE5C2EA@.microsoft.com...
>I create a datagrid using the Web Forms Toolbox
> The dataadapter,dataset and databind() code runs in a button eventhandler
> The headertext is currently determined by the column names of my SQL
> select statement there.
> How can I change the headertext programatically in the codebehind? ... I
> don't want to change the preexisting code if at all possible.

Set more than one ValidationGroup to a Button?

ASP.NET 2.0
Is it possible to set more than one ValidationGroup to a Button?
I have two sets of controls on a Web page, into two different
ValidationGroups. I would like when the user clicks on a specific button,
that both groups be validated.
Thanks.
MichaelI don't see any way of this directly using the .NET 2.0 Framework. I'm
sure, given the time, you could come up with a custom Button object and
custom Validation object that could handle it.
Another option could be to use the CustomValidator object. It provides with
both server and client validation functionality, but I'm not how complex it
might be with your validation needs. It's at least worth a look.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."
"news.microsoft.com" <someone@.somewhere.com> wrote in message
news:eq3UiunPGHA.3848@.TK2MSFTNGP12.phx.gbl...
> ASP.NET 2.0
> Is it possible to set more than one ValidationGroup to a Button?
> I have two sets of controls on a Web page, into two different
> ValidationGroups. I would like when the user clicks on a specific button,
> that both groups be validated.
> Thanks.
> Michael
>
With validation groups in ASP.NET 2.0, you can only match a button to one
group name.
Just so you know that the option exists, my replacement for the Microsoft
validators, "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx) offers validation groups with the
extensions that you need. You can use "*" in the button's Group property to
fire all validation groups. Similarly, the ValidationSummary can have a
group name of "*" to show all validators on the page, if you like.
-- Peter Blum
www.PeterBlum.com
Email: PLBlum@.PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"news.microsoft.com" <someone@.somewhere.com> wrote in message
news:eq3UiunPGHA.3848@.TK2MSFTNGP12.phx.gbl...
> ASP.NET 2.0
> Is it possible to set more than one ValidationGroup to a Button?
> I have two sets of controls on a Web page, into two different
> ValidationGroups. I would like when the user clicks on a specific button,
> that both groups be validated.
> Thanks.
> Michael
>

Set more than one ValidationGroup to a Button?

ASP.NET 2.0

Is it possible to set more than one ValidationGroup to a Button?

I have two sets of controls on a Web page, into two different
ValidationGroups. I would like when the user clicks on a specific button,
that both groups be validated.

Thanks.
MichaelI don't see any way of this directly using the .NET 2.0 Framework. I'm
sure, given the time, you could come up with a custom Button object and
custom Validation object that could handle it.

Another option could be to use the CustomValidator object. It provides with
both server and client validation functionality, but I'm not how complex it
might be with your validation needs. It's at least worth a look.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"news.microsoft.com" <someone@.somewhere.com> wrote in message
news:eq3UiunPGHA.3848@.TK2MSFTNGP12.phx.gbl...
> ASP.NET 2.0
> Is it possible to set more than one ValidationGroup to a Button?
> I have two sets of controls on a Web page, into two different
> ValidationGroups. I would like when the user clicks on a specific button,
> that both groups be validated.
> Thanks.
> Michael
With validation groups in ASP.NET 2.0, you can only match a button to one
group name.

Just so you know that the option exists, my replacement for the Microsoft
validators, "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx) offers validation groups with the
extensions that you need. You can use "*" in the button's Group property to
fire all validation groups. Similarly, the ValidationSummary can have a
group name of "*" to show all validators on the page, if you like.

-- Peter Blum
www.PeterBlum.com
Email: PLBlum@.PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"news.microsoft.com" <someone@.somewhere.com> wrote in message
news:eq3UiunPGHA.3848@.TK2MSFTNGP12.phx.gbl...
> ASP.NET 2.0
> Is it possible to set more than one ValidationGroup to a Button?
> I have two sets of controls on a Web page, into two different
> ValidationGroups. I would like when the user clicks on a specific button,
> that both groups be validated.
> Thanks.
> Michael