In SQL Reporting Services when using the web ReportViewer control I had the problem of my reporting not showing when changing ReportServerUrl and ReportPath. It turned out that I hadn't set ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote.
OK, so that part doesn't have anything to do with changing the properties, but after that I found that after I fixed that problem I could see data for the report, but it would not change the report display when changing these properties. It turned out that I needed to call the Refresh method. I had been looking for something similar to that, but was looking on the ReportViewer control itself. It turns out it is on the ReportView.ServerReport object.
Wednesday, May 9, 2007
Friday, April 6, 2007
Client Side Event Handlers Appear to Short Circuit RadioButton Server Side Handled
ASP.Net 2.0 RadioButton
I had a handler for the body tag's OnLoad event and that did not seem to conflict with the Page_Load server event. In that event I did something like this:
document.getElementById("rbDocView").onclick=function(){ RadioClick();}
document.getElementById("rbItemView").onclick=function(){ RadioClick();}
RadioClick();
Once I added this the server side CheckChanged event stopped firing.
I had a handler for the body tag's OnLoad event and that did not seem to conflict with the Page_Load server event. In that event I did something like this:
document.getElementById("rbDocView").onclick=function(){ RadioClick();}
document.getElementById("rbItemView").onclick=function(){ RadioClick();}
RadioClick();
Once I added this the server side CheckChanged event stopped firing.
Labels:
ASP.Net,
ASP.Net 2.0,
CheckChanged,
onclick,
RadioButton
Changing Value of RadioButton Does Not Change Form
ASP.Net 2.0 Server Side RadioButton
I had two RadioButtons in the same group on a form. I created a server side handler for the CheckChanged event. If a certain criteria was true then I needed to show an error and set the checked property back to its previous value. The problem I ran into was that it wasn't updating the form.
As I looked at the source of the page I found that both radiobuttons had their checked attribute set to "checked". It appears that it displays as checked whichever is the last radiobuton with its attribute set. The remedy was to manually set both radiobuttons' checked property on the server and not assume that setting the checked property to true of one that is in the same group that the other would automatically get set to false.
I had two RadioButtons in the same group on a form. I created a server side handler for the CheckChanged event. If a certain criteria was true then I needed to show an error and set the checked property back to its previous value. The problem I ran into was that it wasn't updating the form.
As I looked at the source of the page I found that both radiobuttons had their checked attribute set to "checked". It appears that it displays as checked whichever is the last radiobuton with its attribute set. The remedy was to manually set both radiobuttons' checked property on the server and not assume that setting the checked property to true of one that is in the same group that the other would automatically get set to false.
Friday, March 9, 2007
Creating a new XMLNode instance in .Net
The .Net XMLNode can not be instantiated with new since it is an abstract class. To create a new one you have to create one of the more specific types like XMLElement or XMLAttribute. Unfortunately it doesn't look like you can just do New XMLElement either. You must use an XMLDocument and it's CreateElement method.
Here's a situation I had. I had a method that was taking in a value and a node. I wanted to assign that value to the node. Then I had the problem of the node not existing in certain circumstance. I wanted to create a new node and just give it a name and a value. I decided to pass in the parent of the node and then append it to the parent. I couldn't do that because it wouldn't know how to deal with that node without knowing if it is an element or an attribute or whatever. So I needed an element, but couldn't just do a New XMLElement either. I used the XMLDocument, excuted CreateElement and then passed that to the AppendChild method of the parent node. Note that the XMLDocument that you are attaching the Element to much be the same document that was used to create.
private Sub MyMethod(ByVal Value As String, ByVal n As XmlNode, ByVal ParentNode As XmlNode, doc as XMLdocument)
dim ele as XMLElement
If IsNothing(n) Then
ele = doc.CreateElement("MyName")
ele.InnerText= Value
ParentNode.AppendChild(ele)
End If
End Sub
Here's a situation I had. I had a method that was taking in a value and a node. I wanted to assign that value to the node. Then I had the problem of the node not existing in certain circumstance. I wanted to create a new node and just give it a name and a value. I decided to pass in the parent of the node and then append it to the parent. I couldn't do that because it wouldn't know how to deal with that node without knowing if it is an element or an attribute or whatever. So I needed an element, but couldn't just do a New XMLElement either. I used the XMLDocument, excuted CreateElement and then passed that to the AppendChild method of the parent node. Note that the XMLDocument that you are attaching the Element to much be the same document that was used to create.
private Sub MyMethod(ByVal Value As String, ByVal n As XmlNode, ByVal ParentNode As XmlNode, doc as XMLdocument)
dim ele as XMLElement
If IsNothing(n) Then
ele = doc.CreateElement("MyName")
ele.InnerText= Value
ParentNode.AppendChild(ele)
End If
End Sub
Friday, February 23, 2007
Server Side Variables in an Alert in ASP
If you need to see the value of a server side variable in ASP you can insert a script tag an inside the script tag you can put a server side variable of function call. It seems a little odd at first and if you are using the Visual Studio IDE the color coding even makes you think you are doing something wrong, but it seems to work.
Here's the situation. You have loaded something into a server side variable and you want to find out what that value is.
------------------------------------

------------------------------------
Note the single quotes around the server tags. Without the single quotes, the JavaScript evaluates the contents of the variable as code and not a string. Also note the = in front of the server side variable. This causes it to return the value of the variable.
In the image I attached I failed to insert the attributes for the script tag, so be sure you do that to tell it that it is JavaScript.
Here's the situation. You have loaded something into a server side variable and you want to find out what that value is.
------------------------------------
------------------------------------
Note the single quotes around the server tags. Without the single quotes, the JavaScript evaluates the contents of the variable as code and not a string. Also note the = in front of the server side variable. This causes it to return the value of the variable.
In the image I attached I failed to insert the attributes for the script tag, so be sure you do that to tell it that it is JavaScript.
Subscribe to:
Comments (Atom)