|
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.
|
|
|
|
|
You have to Validate your date for the Year depending upon the Months and the year.
Regards,
Satips.
|
|
|
|
|
Ya Dear I know but can u give me any help regarding to that. Can u give me any regular expression for that.
|
|
|
|
|
For Date Validation
Use this Code
("([0-3]{0,1}[0-9])" +"(? :/([01]{0,1}[0-9])/)" + "|(?:\\-([01]{0,1}[0-9])\\-))" + "((?:19|20)[0-9]{2})");
Regards,
Satips.
|
|
|
|
|
|
Check now i have Changed the code.
Regards,
Satips.
|
|
|
|
|
It is also not working dear.
|
|
|
|
|
|
Trying to run my app. in VS 2005 and keep getting this error message:
"This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory"
Anyone any ideas how to solve this problem or what it is.
I cannot find app_offline.htm.
macca
|
|
|
|
|
there is one main reason for this error which i have faced
when your IIS Server is down VS.Net2005 Framework would automatically add a file called app_offline.htm
Remove this file and then restart your IIS and then try.
there might be some other error which would be coming but since IIS is down and framework doesnot get any response. it adds the page app_offline.htm and start showing instead of the actual error.
Regards,
Satips.
|
|
|
|