|
Hello,
I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel.
On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible.
But it is not working. Is there any work around so that I can make my pannel visible w/o postback?
Thanks in advance.
Regards,
Milind.
|
|
|
|
|
If it's not inside an update panel, then you'd need to write your own javascript to make it visible.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
All the content that is inside the Update panel will be posted back to the client and refreshed in the client as response. So it is impossible to update controls outside updatepanel from the server.
As Christian suggested, you need to pass some Javascript to the client which might show the Panel.
But there is another scenario. ASP.NET doesnt render controls that are made Visible=false. So from client side using javascript, you will not going to find the control.
So the solution will be :
1. Use pnl.Style.Add(HtmlTextWriterStyle.Display, "none") to make the panel invisible instead of pnl.Visible=false //To ensure that pnl is rendered in the client.
2. In postback of UpdatePanel use RegisterStartupScript to pass a javascript that resets the pnl.style. Your javascript might look like
"document.getElementById('" + pnl.ClientId + "').style.display='none';"
|
|
|
|
|
Or you could put ASP:Panel inside another update Panel and set it's update mode to Always,
But I think javascript will still be better
|
|
|
|
|
Hi,
I have a code here which makes the active links bold in IE7
Is there some work around to make it work in mozilla and higher versions of IE
a:active{font-weight:bold}
Thanks
Shankbond
|
|
|
|
|
What happened to you. It should be perfectly working in all browsers.
|
|
|
|
|
Don't know but not working on my end?
Any suggestions
Thanks
Shankbond
|
|
|
|
|
I think there must be some other css which overrides this. Check out.
You Can make a css class for the same and add using javascript when mouse comes over the anchor. Its an easy fix.
Or you can also use span to behave similar to anchor. Use onclick to navigate in span.
You can take either approach I think.
|
|
|
|
|
Hi guys,
Recently I've been experimenting with converting csv files from Yahoo Finance to XML data, and there is a great article on MSDN site about how to do so, with sample code provided. However, there's a "GenerateDataSet" class that fails to get recognized by my VWD 2008 Express, and I've tried importing all sorts of possible namespaces. After doing some research, it seems to be a Windows Form component rather than a web form component. I understand that the "GenerateDataSet" class is supposed to put the csv datastream into a dataset, however I'm not familiar enough with asp.net to come up with an alternative to make it work. Could you please help me? I'd greatly appreciate it!
Part of the sample code provided by MSDN (this function is supposed to read csv data online and return XML data:
<br />
Public Function getStockXML(ByVal strTicker As String, ByVal strStartDate As String, ByVal strEndDate As String) As XmlDocument<br />
Dim xReturn As New XmlDocument()<br />
Dim result As New DataSet()<br />
Dim wc As New WebClient()<br />
Dim yData As Stream = wc.OpenRead(sYahooURI) 'sYahooURI is the url link to Yahoo Finance csv file<br />
result = GenerateDataSet(yData)<br />
<br />
Dim stringWriter As New StringWriter()<br />
Dim xmlTextwriter As New XmlTextWriter(stringWriter)<br />
result.WriteXml(xmlTextwriter, XmlWriteMode.IgnoreSchema)<br />
Dim xRoot As XmlNode = xReturn.CreateElement("root")<br />
xReturn.AppendChild(xRoot)<br />
xReturn.LoadXml(stringWriter.ToString())<br />
Return (xReturn)<br />
End Function<br />
|
|
|
|
|
csv means Comma separated values. Why dont you use normal for loops to put all the values into a DataTable .
If you cant do it yourself, let me know with a sample demo of the schema. I will give you the code.
|
|
|
|
|
Thank you so much Abhishek for your help. I actually have thought about using for-next loops before, but when seeing the example posted on MSDN is doing it using a simple "GenerateDataSet" function, I thought it's a shortcut.
The original CSV file from Yahoo Finance looks like the following:
Date,Open,High,Low,Close,Volume,Adj Close
2009-10-23,15.91,16.10,15.41,15.48,27610400,15.48
2009-10-22,15.15,15.51,15.01,15.43,17517400,15.43
Basically I'm just having problem with the "result = GenerateDataSet(yData)" line, because I couldn't find the namespace that "GenerateDataSet" is under. If you could please give me the code for writing that csv stream into a dataset, that would be great!
Public Function getStockXML(ByVal strTicker As String, ByVal strStartDate As String, ByVal strEndDate As String) As XmlDocument<br />
Dim xReturn As New XmlDocument()<br />
Dim result As New DataSet()<br />
Dim wc As New WebClient()<br />
Dim yData As Stream = wc.OpenRead(sYahooURI)<br />
result = GenerateDataSet(yData)<br />
Dim stringWriter As New StringWriter()<br />
Dim xmlTextwriter As New XmlTextWriter(stringWriter)<br />
result.WriteXml(xmlTextwriter, XmlWriteMode.IgnoreSchema)<br />
Dim xRoot As XmlNode = xReturn.CreateElement("root")<br />
xReturn.AppendChild(xRoot)<br />
xReturn.LoadXml(stringWriter.ToString())<br />
Return (xReturn)<br />
End Function
For your information, here's the link to that MSDN website:
http://msdn.microsoft.com/en-us/magazine/ee294455.aspx[^]
Thanks again for your help!
|
|
|
|
|
|
|
Where do you to to implement it ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi,
I want to use a WYSIWYG editor for my project in asp.net 2.0 project which should free and having features like table, image uploading.
I have search many editors on web but either they are paid or having limitation.
Kindly suggest me if available.
Thanks in advance,
Abbas
|
|
|
|
|
|
ya, I already seen it, it's good but not having features as table or images.
Thanks for reply,
|
|
|
|
|
Try this[^]
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
Hi kashif,
I already seen it, it's good but not having features as table or images.
Thanks,
|
|
|
|
|
|
|
|
Hi all i want to disable the Refresh button
i just addeded javascript function for F5. and it works fine
here is my code works fine for F5
"function refresh()"+
"{"+
"if (116==event.keyCode)"+
"{"+
"event.cancelBubble = true;" +
"event.returnValue = false;" +
"event.keyCode = 0;" +
"return false;" +
"}"+
"}"+
"document.onkeydown = function (){ refresh(); } ");
but i cant diable the icon shown in tool bar for Refresh
can some one help me
thanks in advance
|
|
|
|
|
Try This..!
<Script language="javascript">
function checkKeyCode(evt)
{
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if(event.keyCode==116)
{
evt.keyCode=0;
return false
}
}
document.onkeydown=checkKeyCode;
</script>
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Controlling browser buttons is an idiotic idea. Actually you cant do it with 100% perfection.
|
|
|
|