URL link in SQL DIRECT
It's my first time using SQL and I want to have a text in a cell direct to a URL, just like the href tag in html; how can I do that?
I don't want the URL to appear but I want the user to click on that tex开发者_JAVA百科t and then direct him to a URL.
btw, Im using ASP.NET 2010.
To not let see in the page the url, you can put in your page a button with a param (for example the ID of the record pointing to the right url). Then from your postback redirect the user to the relative url. This way you don't expose the url with an a
tag.
Following steps will solve your problem
1)create a procedure to fetch data from database using dataset or datareader, i am assuming that you are using dataset .
2)On aspx page . take a hyperlink button , and bind it with hyperlinkId.text=ds.table[0].rows[0]["URL"].tostring();
That will work as an anchor button for you
精彩评论