ASP.net GridView to display DetailsView on other page

So, I’m still working on that immo website.
On some GridView.aspx page, users see a GridView  with all items in my database.
I added a select button in front of each row.
I want the to redirect the user to some other page DetailsView.aspx when he/she clicked the button.
The problem, there is no redirect option in the GUI.
Again, Microsoft… loose the markup options in the Properties window and add some more functionality.

The solution for the people out there with the same frustration:

Double click the GridView item in your GUI.
You’ll get something as:

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged

End Sub

Now add the following code (note that this is in vb, so if you use C#, adjust the syntax)

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
           Response.Redirect("DetailsView.aspx?ID=" & GridView1.SelectedValue)
End Sub

You might also want to add or modify some lines in your sqlDatasource (of the destination page) to match these lines.
This way you’ll see the DetailView of the item you clicked in the GridView.

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
 SelectCommand="SELECT * FROM [Tablename]where [ID] = @ID"
<SelectParameters>
 <asp:QueryStringParameter QueryStringField="ID" name="ID" />
 </SelectParameters>
 </asp:SqlDataSource>

ASP.net mess

I’m currently working on some basic Immo website, in ASP.net 4.0.
(Part of the Exams)
I have to admit, programming is not my cup of tea… but I’m getting frustrated over all those (minor) flaws in Vistual Studio 2010.

If you’re setting up a registration page using the CreateUserWizard form the Toolbox, you’ll find some lack of properties-fields in the GUI.
In my case, I had to assign a default role to each new registerd user.
Nowhere in the Gui there is such thing to be found… sure… changing colors etc… but some REAL functionality… forget it!
The way to go is like this:
Just add some chunk of code.

Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
            Roles.AddUserToRole(CreateUserWizard1.UserName, "Member")
End Sub

I’m some kind of disappointed.
If you create some Wizard, why not do a good job, and add all possible options to the GUI?
Should you find yourself having too many options… perhaps, get rid of the image and color options?
There is such a thing as CSS for that!

Grmbl….