|
Thats not a valid operation in a buttonfield apparently, guessing because its nested in the datagrid
|
|
|
|
|
Ah, It looks like your method you created doesn't have any handels on it. so it is not linked to any event. Most likely you need to add something like handels gridview.RowCommand
you would also want to add some code in your method that does something like:
if e.commandName = "Delete" Then
So that your code only runs when a delete command is passed to the method.
Hope that helps.
Ben
|
|
|
|
|
still not much joy it doesn't like the handles statement, can't track down my command thru the windows, jus says signature not recognised
|
|
|
|
|
Go to your aspx.cs file where your datagrid is located. Then in the left drop down find the datagrid control. Then in the right dropdown you should be able to select the datagrid command event. When you select it, it should create the method for you. Take your code from the method you created and put it in the auto generated method.
Hope that helps.
Ben
|
|
|
|
|
Hi ,
I m using a webservice to copy a file to a remote server. When i do that i m getting ' Access to path denied' error. Pls let me know what permission i need to give. My OS is windows 2000.
I tried giving impersonate = true in web.config.
Thanks in advance
Priya
|
|
|
|
|
Your webservice is running under an application pool. The user that the app pool is running as needs rights to write to that remote server. I would suggest creating a new app pool that only the web service will run under. Then you could create a specific network user that has just the correct rights to write to your remote server.
Hope that helps.
Ben
|
|
|
|
|
Hi
how can i call server side function on onblur event of textbox.
i write this tag but it gives error.where i am
going wrong. onblur=<%# checkname() %>
plz help
df
|
|
|
|
|
Your only bet would be to use ajax. Normally you can not call sever side functions from javascript. The javascript is running on the local client not on the web server.
Ben
|
|
|
|
|
Yes, me too looking for the same but hardly found any proper answer. Please provide some ans.
|
|
|
|
|
Hi,
I have created a menucontrol in asp, at the moment you must click on the text to make your selection, i would like to know if there is a way to make it so that when you click anywhere in that menu items panel it will make the selection as havin to click on the text is not very effective,
thank you
gav
|
|
|
|
|
Hi,
I asked this same question sometime ago and the good folks here gave me the answer, so it's only fair to pass it on
The problem with the bog standard Menucontrol is it's based on tables, and so only support clicking on the text. However, there is a relatively easy way to sort this out...
CSS Freindly Control Extender!
Check out this link: http://www.asp.net/cssadapters/[^]
|
|
|
|
|
I have been playing with System.Diagnostics and am able to get the event logs from the pc. Can i get other information like CPU usage and Hard Drive Space?
Also Can I get this for multiple server on my network?
Thanks
|
|
|
|
|
Hi,
Iam using nLog logger tool in my ASP.NET application to log my events and errors.Iam new to NLog and just learning the basics. I want to log events to my database and for my application I have to also log the customerid which i get on my form for every log. How do I go about it ? This is what I have in my config file.
<targets>
<target name="database" type="Database">
<dbProvider>mssql</dbProvider>
<dbHost>HOSTNAME</dbHost>
<dbDatabase>DBNAME</dbDatabase>
<dbUserName>USERID</dbUserName>
<dbPassword>PASSWORD</dbPassword>
<commandText>INSERT INTO LOG(LOG.DATE,LOG.LEVEL,LOG.LOGGER,LOG.MESSAGE) VALUES(@time_stamp,@level,@logger,@message);</commandText>
<parameter name="@time_stamp" layout="${date:format=yyyy-MM-dd HH\:mm\:ss}" />
<parameter name="@level" layout="${level}" />
<parameter name="@logger" layout="${logger}" />
<parameter name="@message" layout="${message}" />
</target>
</targets>
This works just fine. I want to add another column to the Log table called CustomerID, how do i change the config file and how do i use it in my code. Example would be great !! Iam using VB.NET and VS 2005
Thanks
RH
|
|
|
|
|
Please Help!!
I an working on a VB application with a datagrid. In the datagrid, i have create a ButtonColumn with "Delete" Command. I also create OnItemCreated="dgProgram_ItemCreated" for the datagrid. I want to confirm the user before delete a row from datagrid. I also want to pass an Object value of that row to client side (example: "are you sure to delete the row number with that name bluh bluh?"). I don't understand why the javascipt always fired before the ItemCreated (dgProgram_ItemCreated function). That's why i can't get the value to pass to javascript.
Please Help. Thanks in Advance!!!
Sub dgProgram_ItemCreated(ByVal sender As Object, ByVal e As DataGridItemEventArgs)
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
Dim lbl As New Label
lbl = CType(e.Item.FindControl("lblProgram"), Label)
//program is a hidden field
Me.program.Value = CType(lbl.Text, String)
Dim btn As Button
btn = CType(e.Item.Cells(14).Controls(0), Button)
btn.Attributes.Add("onclick", "return deleteconfirm(program)")
End If
End Sub
function deleteconfirm(v)
{
return confirm('Are you sure to delete this program: '+ v.value);
}
|
|
|
|
|
You might have better luck putting this in the ItemDataBound event...
Otherwise, you could try looping through the rows after binding the database (in whatver sub you do that) with something like the below, amending the FindControl paramter with the name you have assigned the delete button in your datagrid. You can find you lblProgram value similarly, and amnend the js accordingly.
Dim c As Button
Dim dgItem As DataGridItem, js As String
For Each dgItem In dgProgram.Items
js = "javascript: return confirm('Do you really want to delete this item?');"
c = dgItem.Cells(14).FindControl("btnDel")
c.Attributes.Add("onclick", js)
c = Nothing
Next
Good luck..
Fred
|
|
|
|
|
I've tried both in sub ItemCreated and ItemDataBound but it does not work. Do you know How and Where to put the (Sub ItemCreated) of the datagrid so it only run when you click on the datagrid or the button inside the datagrid???
In my application now, when i debug it, it run over and over and over again that i have no idea why it does that.
Thanks,
Don
|
|
|
|
|
Well it will do - it will run once for every row in your datagrid, as each row is created (or bound to the data) - that's what these events are; that's why theya re called what they are.
What you are trying to do is attach the appropriate javascript to each button, one on each row, so you want it run over and over like that! All you need to do is fugure out the right code to do it.
You are on the right tracks, but it's hard ot know exactly where you;re going wrong... there are lots of examples on the web about how to do the sort of thig you want. Type "datagrid delete confirm" into Google... or try this site:
http://www.datagridgirl.com/[^]
or this
http://www.4guysfromrolla.com/[^]
both have loads of great tutorials and examples....
Fred
|
|
|
|
|
HI
i want to execute some code after focus move from textbox.is there any
event available similier to onblur event for html textbox
for asp:textbox.
And one more thing when the Keypress
event is executed.(this event is of html textbox).which of the event first
occur
---textchanged event
------keypress event
df
|
|
|
|
|
I use the onblur event for asp textboxes.
<asp:TextBox TabIndex="4" ID="tbCallersName" runat="server" MaxLength="50" onblur="javascript:toUser_LostFocus(this);" Width="197px"></asp:TextBox>
Example I just copied and pasted from my code
hope this helps
Cheers
Cads
|
|
|
|
|
Hi Senseicads
but the function i have called on onblur event is a server side
function not defined in javascript.How can i call this.
thanks.
df
|
|
|
|
|
Just stick the method inside some serverside tags.
onblur="<% methodname() %>"
|
|
|
|
|
HI Senseicads
It gives syntax error.
Thanks.
df
|
|
|
|
|
Sorry my fault
Wrote it with a typo! missed off an '='
<%= method() %>
if you can't get it to do what you need here, and you have Ajax installed you can always try using pagemethods.
Cheers
Ian
|
|
|
|
|
Thanks for u r valuable rply but still it give syntax error.
Thanks,
df
|
|
|
|
|
Hi All,
I have this reqular expression for Date Validation i-e (dd/MM/yyyy)
/(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/
It works fine, But there is a problem, i-e if I give 29/02/2007 then it will not validate date and code will give error. Cuz Feb is of 28, similarly same problems for other months like April is of 30. If I give 31 it will not validate Date and my code will give error.
Any help regarding to this.
Thanks in Advance.
|
|
|
|