So I spent a few days developing a personal website in Visual Studio 2005 (I do have access to 2008 if need be) and created a "portfolio" folder containing samples of my previous work. I wanted this folder protected, so I made a login.aspx page and dropped in a login box from the toolbar. I also went to web site administration and required authentication for the folder. Everything worked fine in testing using my computer as the local server. I purchased a website, bought hosting from Omnis and have my site stored on a Windows server.
My problem: SQL Server 2005 is not supported, so my login page and SQL Express DB aren't working.
What are my options as far as fixing/reconfiguring go? My web host supports Access and MySql.
Any help would be greatly appreciated. I'm a bit novicial and need to find out the best practice in a situation like this.
Hello everyone ,
I've got a gridview and it's sqldatasource . I;ve done some changes to the grid view(added some columns) and now i want to modify a query from the datasource ( corresponding to changing only one column with another one in the grid view ) . But when i try to recreate the query for the sqldatasource , the gridview loses all the new columns i had added manually ( bound fields , image fields etc ) . How can i keep them and just modify one column ?
Thank you !
Just in case this can help anybody else, the only solution I was able to find around the Bound GridView SelectCommand was to use a store procedure and pass parameter options via Session variables to return dynamic record sets.
I'm an A level student in the UK studying computing. For my project, I have to create a website for a real company. I'm using Visual Web Developer 2008 Express Edition along with MS Access for a database.
I've come across a slight problem which I don't yet have the knowledge for and was wondering if somebody could enlighten me. You see, I have a news page, which uses a datalist which is bound to an MS Access database. This datalist uses a query to display:
- ID (Hidden)
- Date published
The database itself also holds the article as a memo in a field. I want to implement a button, which will redirect the user to a page containing the article. My idea was to send the ID of the record from the datalist to another page, and use this information as an integer on the next page for a query, which will select the matching article (matching the article ID to the integer), and present it on the page. Here are the code snippets to help understand better:
'Event to transfer page control to NewsArticle.aspx
Protected Sub Go_To_Article(ByVal sender As Object, ByVal e As EventArgs)
Dim IDLabel_Value As Integer
IDLabel_Value = 'here iswhere I don't know how to select the ID field of datalist1
Response.Redirect("~/NewsArticle.aspx?IDLabel_Value = " & CStr(IDLabel_Value))
And I don't know how to retrieve the ID value send to NewsArticle.aspx I have looked up on a method which uses get property on the first page and then Dim As Result on the second page. But even then, I don't know how to retrieve the ID field of the record from a datalist. Any help would be greatly appriciated.
If you select a record on page 1 and then need to use it in page 2, there's two common ways to do this:
1 - make page 1 and page 2 controls on the one page and let viewstate store it
2 - write a generic page to show a record based on id, and pass the id in on the URL. This second way has the advantage that people can bookmark the same page with different ids on the URL and go back to them.
You can also use cross page postback in later versions of .NET but that is really hacky.
I had followed the tutorial yusuf kindly linked me (and thank you for it ^_^), but i noticed in the source code, the author is using <form method="post"></form>, whereas I can't put a form in my news.aspx page because I've already implemented one in the master page. This has proven to be one hell of a coursework!
The problem is probably that IDLabel is inside a template, there's not ONE IDLabel to refer to, they are buried in the gridview. What you do is use that <%# Eval syntax to render a button or link for each row, I'd use a linkbutton if you need a button on the form. Then you build your URL with the query parameter inside the list, so the id is rendered correctly for each row.
ah! I think you and christian have found the source of the problem. Christian was right in saying the IDLabel does not have one thing to refer to. Your suggestion on debugging
seemed to have proved it because it's saying NullReferenceException was unhandled, which probably could be concluded that it's just not getting the ID value off the datalist.
Hehe I figured, the only way to really challenge myself is to just stretch my resources as much as possible to get information I need . But this has proven quiet trivial and my books don't cover this. Google works to some extend but it's a bit tricky to learn independant methods and then try to fuse them and translate to one language. Nethertheless I do enjoy it ^_^.
So I guess the next step really is how to render a link button in the <%# Eval("ID") tag? Any links to tutorials and suggestions are welcome ^_^.
Big thank you to christian and yusuf for helping me out. You guys rock!
Note: [xmlns:asp="#unknown">] is supposed to be [><%# Eval("ID") %>]. Don't know why it comes out messed up but there you go
Now this button works because it goes to the next page but it doesn't submit the query string however I know why and that's because I don't know how to extract the Eval("ID") from the button hehe. So the part i'm stuck on is this:
I know (well, I get the feeling) that the this.GoToArticle is supposed to be expanded more but the intellisense is confusing me haha. I have placed the Eval in between the opening tag of the link button and the closing tag of the link button. If I could extract this value (maybe as a string?) it might fix it. I have a hunch I should be able to, because you can extract values from text boxes as strings. ]]>
So I think this is some headway. I'll also be looking up methods of posting query strings from inside an item template but I think all of us are starting to get there .
I've been searching around and came across CommandArgument codes. They seem to be practicle for putting the <![CDATA[<%# Eval("ID") %>]]> in them. I'm currently looking at a way to use this in a query string. I had tried the following:
I may have hit something good here. I just have to figure out how to stop the overload error! any help would be appriciated .
UPDATE: Ah! Okey guys I've managed to get the query to post to the next page! The commandargument and commandname methods were correct. More importantly, I needed to add OnItemCommand to the datalist's ASP tag! If anyone requests source I would gladly post a generic copy . I think after this I might actually post an article about implementing a button in a datalist to post ID values to another page, since it required a lot of cross referencing from google to get it done .
Christian: big thank you for hinting the right direction by using the Eval to render the link button.
Yusuf: big thank you as well for directing me to posting values from one page to another using a query string.
and thank you both for aiding me through this. Now I need to get the generic page to display the article. I'm trying
nevermind I've managed to get the values to pass to the other page . The next step is to use this value to match it with the ID key of a database (which has been bound to a data control on the other page) to obtain the corresponding article. Any suggestions I'm open to .
I have a simple question. I am trying to display a jpg on my web page. I have a help.aspx page with this line of code but it does not display. I created a directory under App_Data named JPG and the jpg image is in there. When I use the intelisense, VS can locate the jpg, but when I run the page, the image is not displayed. I have tried using just a plain html page and it does not work either. I am missing something, but what?