Link to home
Start Free TrialLog in
Avatar of mah766
mah766

asked on

ASP.NET

I am using visual basic 2008 and I am doing my final project and every time I put my GridView it doesn't appear in the debugging. Please help me
Avatar of Chandan_Gowda
Chandan_Gowda
Flag of United States of America image

can u please be more clear on the question that you have asked
Avatar of Obadiah Christopher
Ya that's true. Please be more clear and if possible post snapshots of the problem u r facing.
Avatar of mah766
mah766

ASKER

OK, the problem basically is that when I drag the GridView from the tools bar in the body and connect it with fields I want to display. After I hit Display in Browser Nothing appear. I got empty page
Here is my code :
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="Admin" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server">
        </asp:GridView>
    
    </div>
    </form>
</body>
</html>

Open in new window

Gridview needs a datasource and something to display.

Here is an article on databinding.
http://www.4guysfromrolla.com/articles/110905-1.aspx
Avatar of mah766

ASKER

Even when I add datasource still Nothing appear. I don't now it was working fine
So the question is what changed?  The code above has no binding unless it is in code behind.  Do you have a sample of code that was working before but isn't now?

Have you tried starting a new website in Visual Studio, perhaps one of your files (web.config?) is changed somehow.

What version are you using?
Avatar of mah766

ASKER

Yes I tried that, and I am using VB 2008. Actually it is the same code I put above
Can we see the file
Admin.aspx.cs?
Avatar of mah766

ASKER

Here is the code
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class Admin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
}

Open in new window

Again, there is no databinding code in either file, so It is not possible that this used to display something.  Either your code was removed or these are not the files that were working before.

Please read the above article on databinding.
ASKER CERTIFIED SOLUTION
Avatar of mah766
mah766

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mah766

ASKER

I found the solution and it doesn't relate to any of the comment your wrote