Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

ASP.NET(C#) Query String?

$
0
0
Hi,
I need some help with query string,
I load data with enitity framework from mssql database, and all things are succesfully loaded, but... I have some probably stu*id problem, when i try to set "href" i 've problem with query string, string into adress bar is duplicated when i click on some <a href>data</a> from database,

Example:
when i click on first data:
Default.aspx/?show=1
on second
Default.aspx/Default.aspx/show=2

code:
Kategorije(Serbian) == Categories(English)
if (!IsPostBack)
        {
            string output = "";
            DatabaseEntities de = new DatabaseEntities();
            var rez = from p in de.Kategorijes
                      select p;
            foreach (Kategorije k in rez)
            {
                output += String.Format("<a href='Default.aspx/?show={0}'>{1}</a></br>", k.Kategorije_Id.ToString(), k.Naziv_Kategorije);
            }
            Response.Write(output);
        }



I was try to clear query string but still same problem...
In php i used this line of code normally:
$output .= '<li><a href="category.php?show='.$row['id'].'">'.$row['name'].'</a> ('.$check.')</li>';

but in ASP.NET that does not work...

Viewing all articles
Browse latest Browse all 51036

Trending Articles