Hi,
I am opening a rad window from code behind on a button click. The rad window is used to display the contents of a multi-line text box. I pass 3 parameters, strErrorId, strFieldName and strFieldValue, to the window and usually it works fine. But ,I get the error ' ...is not a valid virtural path' when one of the parameters passed to the window contains the name of an aspx page or is stored with multiple lines.
Does anyone know how I can pass these type of parameters correctly?
Thank you for your help.
For Example:
If the strFieldValue parameter is http://localhost:54807/WebForm6.aspx then I get the error
~/Modules/Central/WBF CTL Large Field Display.aspx?&ErrorId=216ad1a1-d3b8-4ef0-b70d-c4b1b44fa0d8&FieldName=HTTP Reference&FieldValue=http://localhost:54807/WebForm6.aspx' is not a valid virtual path.
If the strFieldValue parameter is Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; .NET4.0C; .NET4.0E) then I do not get the error.
If the strFieldValue parameter is the following I also get the error.
HTTP_CACHE_CONTROL:no-cache
HTTP_CONNECTION:Keep-Alive
HTTP_CONTENT_LENGTH:524812
HTTP_CONTENT_TYPE:application/x-www-form-urlencoded
HTTP_ACCEPT:image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
HTTP_ACCEPT_ENCODING:gzip, deflate
HTTP_ACCEPT_LANGUAGE:en-US
HTTP_COOKIE:ASP.NET_SessionId=ipdmwwfq52c0mmit2vqqif55
HTTP_HOST:localhost:54807
HTTP_REFERER:http://localhost:54807/WebForm6.aspx
HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; .NET4.0C; .NET4.0E
Below is the code I am using to open the rad widnow
I am opening a rad window from code behind on a button click. The rad window is used to display the contents of a multi-line text box. I pass 3 parameters, strErrorId, strFieldName and strFieldValue, to the window and usually it works fine. But ,I get the error ' ...is not a valid virtural path' when one of the parameters passed to the window contains the name of an aspx page or is stored with multiple lines.
Does anyone know how I can pass these type of parameters correctly?
Thank you for your help.
For Example:
If the strFieldValue parameter is http://localhost:54807/WebForm6.aspx then I get the error
~/Modules/Central/WBF CTL Large Field Display.aspx?&ErrorId=216ad1a1-d3b8-4ef0-b70d-c4b1b44fa0d8&FieldName=HTTP Reference&FieldValue=http://localhost:54807/WebForm6.aspx' is not a valid virtual path.
If the strFieldValue parameter is Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; .NET4.0C; .NET4.0E) then I do not get the error.
If the strFieldValue parameter is the following I also get the error.
HTTP_CACHE_CONTROL:no-cache
HTTP_CONNECTION:Keep-Alive
HTTP_CONTENT_LENGTH:524812
HTTP_CONTENT_TYPE:application/x-www-form-urlencoded
HTTP_ACCEPT:image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
HTTP_ACCEPT_ENCODING:gzip, deflate
HTTP_ACCEPT_LANGUAGE:en-US
HTTP_COOKIE:ASP.NET_SessionId=ipdmwwfq52c0mmit2vqqif55
HTTP_HOST:localhost:54807
HTTP_REFERER:http://localhost:54807/WebForm6.aspx
HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; .NET4.0C; .NET4.0E
Below is the code I am using to open the rad widnow
Public Sub ShowFieldDescription(ByVal sender As Object, ByVal e As EventArgs)
Dim ibtDescription As ImageButton = DirectCast(sender, ImageButton)
Dim frvView As FormView = DirectCast(ibtDescription.NamingContainer, FormView)
Dim strFieldName As String = ibtDescription.AlternateText.ToString
Dim strErrorId As String = DirectCast(frvView.FindControl("ErrorId"), Label).Text
Dim txtField As TextBox
Dim strFieldValue As String = ""
Select Case strFieldName
Case "Error Description"
txtField = DirectCast(frvView.FindControl("ErrorDescription"), TextBox)
Case "Error Comments"
txtField = DirectCast(frvView.FindControl("ErrorComments"), TextBox)
Case "HTTP Reference"
txtField = DirectCast(frvView.FindControl("SourceHTTPReference"), TextBox)
Case "Form Data"
txtField = DirectCast(frvView.FindControl("SourceFormData"), TextBox)
Case "All HTTP Headers"
txtField = DirectCast(frvView.FindControl("SourceAllHTTPHeaders"), TextBox)
Case "HTTP User Agent"
txtField = DirectCast(frvView.FindControl("SourceHTTPUserAgent"), TextBox)
End Select
strFieldValue = txtField.Text.ToString
Dim rwdFieldDisplay As New RadWindow
Dim strNavigation As String = "~/Modules/Central/WBF CTL Large Field Display.aspx?&ErrorId=" + strErrorId + "&FieldName=" + strFieldName + "&FieldValue=" + strFieldValue
rwdFieldDisplay.ID = "rwdDisplay"
rwdFieldDisplay.NavigateUrl = strNavigation
rwdFieldDisplay.Skin = "Black"
rwmFieldDescription.Windows.Add(rwdFieldDisplay)