lovduv 0 Newbie Poster

***UPDATE Solved***
Needed to change to this
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Page.DataBind();
}
</script>

and this

<script type="text/javascript" src='<%#"http://www.somesite.com/cool.asp?nick=" + Request.QueryString["Nname"]%>'></script>

With the variable Nname from my database via a DeatailsView control.
I am really new to asp.net and I feel that I am just not putting things in the right order?:-|

When I run this I get this error:

Compilation Error


Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1031: Type expected

Source Error:

Line 3: <script runat="server">Line 4: Line 5: protected void Page_Load(.....)Line 6: {Line 7: Page.DataBind()

Here is my entire page........

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[u]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/u]">
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(.....)
{
    Page.DataBind()
}
</script>
 
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nick Listing</title>
</head>
<body>
<form id="form1" runat="server">
<asp:DetailsView runat="server" Width="273px" Height="50px" id="DetailsView1" AutoGenerateRows="False" DataSourceID="nicklisting">
 <Fields>
  <asp:boundfield DataField="Nname" SortExpression="Nname" HeaderText="Nick Name: ">
   <ItemStyle ForeColor="Red" />
   <HeaderStyle BackColor="YellowGreen" Font-Names="Verdana" Font-Bold="True" />
  </asp:boundfield>
 </Fields>
</asp:DetailsView>
<asp:AccessDataSource runat="server" ID="Nicklisting" DataFile="nicks.mdb" SelectCommand="SELECT DISTINCT [Nname] FROM [Results] WHERE ([Nname] = ?) ORDER BY [Nname]">
 <SelectParameters>
  <asp:querystringparameter Type="String" Name="Nname" QueryStringField="Nname" />
 </SelectParameters>
</asp:AccessDataSource>
</form>
<br/>
<div>
<script type="text/javascript">
nick_width = '350px';
nick_border_color = '#000';
nick_header_background = '#eee';
nick_header_color = '#000';
nick_header_size = '14px';
nick_image_show = 'yes'; 
nick_image_align = 'left'; 
nick_body_color = '#000';
nick_body_size = '12px';
nick_new_window = 'yes'; 
varNname= Request.QueryStringField("Nname")
</script>
<script type="text/javascript" src='<%#"http://www.somesite.com/cool.asp?nick=" + Request.QueryString("Nname")%>'></script>
</div>
</body>
</html>

Any Ideas??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.