Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Space presenting as %20 in link

Reply
Thread Tools

Space presenting as %20 in link

 
 
trichert@gmail.com
Guest
Posts: n/a
 
      06-01-2006
Ok , developing a .aspx page with Visual Web Studio (the full page is
at the bottom). Basically its a page that displays all my computers
and the current logged on user pulling data from a live Altiris
database.

This works fine, i have added a feature with a link for me to click to
run radmin against that computer so i can remote control it.

The link shows properly when I hover over it
"S:\apps\!drivers\WindowsETC\rview.bat PCNAME". However if i click the
link it does not work, if i copy the link and paste it into notepad it
shows up as

s:\apps\!drivers\WindowsETC\rview.bat%20PCNAME

Somehow i need to get a true space into this link and not have the aspx
process it. The line in question is line # 17, HyperLink1.NavigateUrl
= "S:\apps\!drivers\WindowsETC\rview.bat " & PCName

What am i doing wrong ?

Here is the entire file :

<%@ Page Language="VB" debug="true"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script runat="server">

Sub RowCommand(ByVal sender As Object, ByVal e As
GridViewCommandEventArgs)
Message.Text = e.CommandName & ", " &
e.CommandSource.ToString & ", " & e.CommandArgument
Dim Grid As GridView
Dim PCName As String
Grid = sender
PCName = Grid.Rows.Item(e.CommandArgument).Cells(1).Text
Message.Text = PCName
' HyperLink1.NavigateUrl = "C:\Program
Files\RAdmin\Radmin.exe /connect:" & PCName
HyperLink1.NavigateUrl =
"S:\apps\!drivers\WindowsETC\rview.bat" & PCName
'Chr(34) = "
'Chr(32) = space


End Sub


</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="Message" runat="server"
Width="419px"></asp:TextBox><br />
<asp:HyperLink ID="HyperLink1" runat="server"
Width="423px">HyperLink</asp:HyperLink><br />
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" OnRowCommand="RowCommand">
<Columns>
<asp:ButtonField
DataTextField="PCName"
HeaderText="Link to RAdmin"
CommandName=DataTextField
InsertVisible="False" />
<asp:BoundField DataField="PCName"
HeaderText="PCName" SortExpression="PCName" />
<asp:BoundField DataField="LoggedOnUser"
HeaderText="LoggedOnUser" ReadOnly="True"
SortExpression="LoggedOnUser" />
<asp:BoundField DataField="Serial" HeaderText="Serial"
SortExpression="Serial" />
<asp:BoundField DataField="Model" HeaderText="Model"
SortExpression="Model" />
<asp:BoundField DataField="FreeDiskSpace"
HeaderText="FreeDiskSpace" SortExpression="FreeDiskSpace" />
<asp:BoundField DataField="ram_total"
HeaderText="ram_total" SortExpression="ram_total" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:eXpressConnectionString %>"
SelectCommand="SELECT [PCName], [LoggedOnUser], [Serial],
[Model], [FreeDiskSpace], [ram_total] FROM [vw_Randy_PC_List] Order By
[LoggedOnUser]">
</asp:SqlDataSource>
</div>
</form>
</body>
</html>

 
Reply With Quote
 
 
 
 
Will Asrari
Guest
Posts: n/a
 
      06-01-2006
Maybe try:

"http://www.link.com&nbsp;" & PCName

 
Reply With Quote
 
 
 
 
trichert@gmail.com
Guest
Posts: n/a
 
      06-01-2006
I appreciate the responce, i tried that and the aspx page actually
shows the &nbsp instead of putting a space in there.


Will Asrari wote:
> Maybe try:
>
> "http://www.link.com&nbsp;" & PCName


 
Reply With Quote
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      06-01-2006
An url can not contain spaces, they have to be encoded. The %20 code is
the encoded form of a space, so that is perfectly correct.

So the problem is not the space in the url.

What do you mean when you say that the link "does not work"? What
happens? Do you get an error message?

Where is the file located? Do you have access to the s: drive from the
client computer?

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Ok , developing a .aspx page with Visual Web Studio (the full page is
> at the bottom). Basically its a page that displays all my computers
> and the current logged on user pulling data from a live Altiris
> database.
>
> This works fine, i have added a feature with a link for me to click to
> run radmin against that computer so i can remote control it.
>
> The link shows properly when I hover over it
> "S:\apps\!drivers\WindowsETC\rview.bat PCNAME". However if i click the
> link it does not work, if i copy the link and paste it into notepad it
> shows up as
>
> s:\apps\!drivers\WindowsETC\rview.bat%20PCNAME
>
> Somehow i need to get a true space into this link and not have the aspx
> process it. The line in question is line # 17, HyperLink1.NavigateUrl
> = "S:\apps\!drivers\WindowsETC\rview.bat " & PCName
>
> What am i doing wrong ?
>
> Here is the entire file :
>
> <%@ Page Language="VB" debug="true"%>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> <script runat="server">
>
> Sub RowCommand(ByVal sender As Object, ByVal e As
> GridViewCommandEventArgs)
> Message.Text = e.CommandName & ", " &
> e.CommandSource.ToString & ", " & e.CommandArgument
> Dim Grid As GridView
> Dim PCName As String
> Grid = sender
> PCName = Grid.Rows.Item(e.CommandArgument).Cells(1).Text
> Message.Text = PCName
> ' HyperLink1.NavigateUrl = "C:\Program
> Files\RAdmin\Radmin.exe /connect:" & PCName
> HyperLink1.NavigateUrl =
> "S:\apps\!drivers\WindowsETC\rview.bat" & PCName
> 'Chr(34) = "
> 'Chr(32) = space
>
>
> End Sub
>
>
> </script>
>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> <asp:TextBox ID="Message" runat="server"
> Width="419px"></asp:TextBox><br />
> <asp:HyperLink ID="HyperLink1" runat="server"
> Width="423px">HyperLink</asp:HyperLink><br />
> <asp:GridView ID="GridView1" runat="server" AllowSorting="True"
> AutoGenerateColumns="False"
> DataSourceID="SqlDataSource1" OnRowCommand="RowCommand">
> <Columns>
> <asp:ButtonField
> DataTextField="PCName"
> HeaderText="Link to RAdmin"
> CommandName=DataTextField
> InsertVisible="False" />
> <asp:BoundField DataField="PCName"
> HeaderText="PCName" SortExpression="PCName" />
> <asp:BoundField DataField="LoggedOnUser"
> HeaderText="LoggedOnUser" ReadOnly="True"
> SortExpression="LoggedOnUser" />
> <asp:BoundField DataField="Serial" HeaderText="Serial"
> SortExpression="Serial" />
> <asp:BoundField DataField="Model" HeaderText="Model"
> SortExpression="Model" />
> <asp:BoundField DataField="FreeDiskSpace"
> HeaderText="FreeDiskSpace" SortExpression="FreeDiskSpace" />
> <asp:BoundField DataField="ram_total"
> HeaderText="ram_total" SortExpression="ram_total" />
> </Columns>
> </asp:GridView>
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString="<%$ ConnectionStrings:eXpressConnectionString %>"
> SelectCommand="SELECT [PCName], [LoggedOnUser], [Serial],
> [Model], [FreeDiskSpace], [ram_total] FROM [vw_Randy_PC_List] Order By
> [LoggedOnUser]">
> </asp:SqlDataSource>
> </div>
> </form>
> </body>
> </html>
>

 
Reply With Quote
 
trichert@gmail.com
Guest
Posts: n/a
 
      06-02-2006
Goran,

Thank you for your responce :

#1) When i click the link nothing at all happens, no error nothing if i
hover over the link it "looks" right.
#2) If i remove the space and the & PCName, and then click the link it
DOES run the rview.bat just fine.
#3) Yes both the client and server have access to the S drive.

Is there a better way to get a dynamic web site to call an executable
file and pass it a variable ?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I18N Question re presenting time remaining Rhino Java 2 02-11-2005 01:35 PM
Why Python style guide (PEP-8) says 4 space indents instead of 8 space??? 8 space indents ever ok?? Christian Seberino Python 21 10-27-2003 04:20 PM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-24-2003 11:15 AM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-23-2003 07:07 AM
Stack space, global space, heap space Shuo Xiang C Programming 10 07-11-2003 07:30 PM



Advertisments