tags:

views:

32

answers:

1

hi,

I developed one application in asp.net and it is working fine in locally. when i upload in online it is giving error like this.

~/User/News/CompleteNews.aspx?newsid=-<span-style="font-weight:-bol.html' is not a valid virtual path.

My code is like this in indiex page

if (e.CommandName == "hollywood")
        {
            Session["videopath"] = "~/index.aspx";
            Session["pagetitle"] = "Back To Home Page ";
            string hollywoodnews = e.CommandArgument.ToString();
            Response.Redirect("~/User/News/CompleteNews.aspx?newsid=" + hollywoodnews.ToString().Replace("","-")+ "");

        }

can u help me please.

this is .aspx code

  <asp:DataList ID="DataList2" runat="server">
    <ItemTemplate>
       <table cellpadding="0" cellspacing="0" align="left" valign="top">
             <tr>
                 <td></td>
                 <td>
                     <table>
                         <tr>
                             <td>
                                 <img src="images/arrow.jpg" border="0" style="margin-right: 10px;" />
                              </td>
                              <td>
                                  <asp:HyperLink ID="lireview2" runat="server" Text='<%#Eval("name1") %>' NavigateUrl='<%# Eval("name1") %>'   CssClass="linktext"> </asp:HyperLink>
                              </td>
                          </tr>
                      </table>
                  </td>
              </tr>
        </table>
    </ItemTemplate>
</asp:DataList>
A: 

It looks like the e.CommandArgument property you are assigning to the newsid querystring value isn't correct. Put a breakpoint in the code on the following line and check it's value when debugging:

string hollywoodnews = e.CommandArgument.ToString();
Andy Rose