Go Back   DeveloperBarn Forums > Programming & Scripting > .Net Development

Sponsored Links

Discuss "Update Panel" in the .Net Development forum.

.Net Development - Learn about the Microsoft.Net framework and how to create powerful web-based (ASP.net) and client-based (Windows Forms) applications utilizing various languages such as C#, VB.Net, J# and others.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1  
Old July 10th, 2008, 04:26 AM
Shem's Avatar
Barn Enthusiast

 
Join Date: Mar 2008
Posts: 261
Thanks: 30
Thanked 5 Times in 5 Posts
Rep Power: 1
Shem is on a distinguished road
Default Update Panel

Hi

I want to use these super cool Ajax controls, i watched a tutorial on it, so i'm
ready to go, .... NOT

when i rap my code in a UpdatePanel, all my controls get un-registered in my
aspx.vb as it tells me i need to declare them! so I do and those errors
dissapear.

Now i have:
Code:
Error	14	Handles clause requires a WithEvents variable defined in the containing type or one of its base types.	C:\Inetpub\wwwroot\keithdesign\views\projects.aspx.vb	52	95	C:\...\keithdesign\
the code it's referring to:
Code:
Protected Sub btnSave_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
        Dim myProjects As Projects = New Projects
        myProjects.Name = txtSvName.Text
        myProjects.ProjectNumber = txtSvProjectNumber.Text
        myProjects.Description = txtSvDescription.Text
        myProjects.TheDate = Now()
        myProjects.EditedDate = Now()
        myProjects.UserID = HttpContext.Current.Session("UserID")
        myProjects.EditedID = 0
        myProjects.Activated = "true"
        myProjects.Idkey = 0
        ProjectsManager.Save(myProjects)
    End Sub
What the heck does it want me to do, I take it things work differently when
using controls inside controls?

Shem
Reply With Quote
Sponsored Links
  #2  
Old July 10th, 2008, 04:29 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

Could you post your update panel code?
Reply With Quote
  #3  
Old July 10th, 2008, 04:33 AM
Shem's Avatar
Barn Enthusiast

 
Join Date: Mar 2008
Posts: 261
Thanks: 30
Thanked 5 Times in 5 Posts
Rep Power: 1
Shem is on a distinguished road
Default

here's my page:
Code:
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="projects.aspx.vb" Inherits="view_projects" MasterPageFile="Default.master" %>
<%@ Import Namespace="Keith.ProjectManager.Bll" %>
<asp:content id="projects" contentplaceholderid="ContentContainer" runat="server">
    <asp:UpdatePanel ID="AddUpdatePanel" runat="server">
        <div id="content_container">
            <table width="100%" border="0" cellspacing="0" cellpadding="1px">
                <tr>
                    <td colspan="3">
                        
                    </td>
                </tr>
                <tr>
                    <td style="width:15%;"><asp:TextBox ID="txtSvName" runat="server" Text="Name"></asp:TextBox></td>
                    <td style="width:15%;"><asp:TextBox ID="txtSvProjectNumber" runat="server" Text="Project No"></asp:TextBox></td>
                    <td style="width:70%;"><asp:TextBox ID="txtSvDescription" runat="server" Text="Description"></asp:TextBox></td>
                </tr>
                <tr>
                    <td colspan="3"><asp:Button ID="btnSave" runat="server" Text="Save" /></td>
                </tr>
            </table>
        </div>
    </asp:UpdatePanel>
    <div id="content_container">
        <table width="100%" border="0" cellspacing="0" cellpadding="1px">
            <tr>
                <td>Name</td>
                <td>Project No.</td>
                <td>Description</td>
                <td>Created By</td>
                <td colspan="2">Edited By</td>
            </tr>
            <asp:Repeater ID="rpProjectList" runat="server" OnItemDataBound="rpProjectList_OnItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td><asp:TextBox ID="txtName" Text='<%#Eval("Name")%>' runat="server"></asp:TextBox></td>
                        <td><asp:TextBox ID="txtProjectNumber" Text='<%#Eval("ProjectNumber")%>' runat="server"></asp:TextBox></td>
                        <td><asp:TextBox ID="txtDecription" Text='<%#Eval("Description")%>' runat="server"></asp:TextBox></td>
                        <td><asp:Label ID="lblCreatedBy" runat="server" Text='<%#Eval("CreatedBy")%>'></asp:Label> <asp:Label ID="lblCreatedDate" runat="server" Text='<%#Eval("TheDate")%>'></asp:Label></td>
                        <td><asp:Label ID="lblEditedBy" runat="server" /> <asp:Label ID="lblEditedDate" runat="server" /></td>
                        <td>Delete</a>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
    </div>
</asp:content>
I also get this error msg:
Code:
 Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Type 'System.Web.UI.UpdatePanel' does not have a public property named 'div'.

Source Error:

Line 3:  <asp:content id="projects" contentplaceholderid="ContentContainer" runat="server">
Line 4:      <asp:UpdatePanel ID="AddUpdatePanel" runat="server">
Line 5:          <div id="content_container">
Line 6:              <table width="100%" border="0" cellspacing="0" cellpadding="1px">
Line 7:                  <tr>


Source File: /keithdesign/views/projects.aspx    Line: 5
Reply With Quote
  #4  
Old July 10th, 2008, 04:37 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

Shem...You haven't put a <ContentTemplate> section in your update panel...
Code:
<asp:UpdatePanel ID="AddUpdatePanel" runat="server">
    <ContentTemplate>
        <div id="content_container">
            <table width="100%" border="0" cellspacing="0" cellpadding="1px">
                <tr>
                    <td colspan="3">
                        
                    </td>
                </tr>
                <tr>
                    <td style="width:15%;"><asp:TextBox ID="txtSvName" runat="server" Text="Name"></asp:TextBox></td>
                    <td style="width:15%;"><asp:TextBox ID="txtSvProjectNumber" runat="server" Text="Project No"></asp:TextBox></td>
                    <td style="width:70%;"><asp:TextBox ID="txtSvDescription" runat="server" Text="Description"></asp:TextBox></td>
                </tr>
                <tr>
                    <td colspan="3"><asp:Button ID="btnSave" runat="server" Text="Save" /></td>
                </tr>
            </table>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > .Net Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
update gridview dynamically peebman2000 .Net Development 27 May 8th, 2008 10:03 PM
Update sql connection string in web config peebman2000 .Net Development 5 April 18th, 2008 12:23 PM


All times are GMT -4. The time now is 08:44 PM.



Content Relevant URLs by vBSEO 3.2.0