Showing posts with label complete. Show all posts
Showing posts with label complete. Show all posts

Monday, March 26, 2012

Please guys, help me out !

Guys,
I have a very very basic user control which is
txtEmail
txtPassword
btnLogIn
I'm working on flowlayout mode...i created a complete web page...it collects some data from the user...and finally added aSubmit button.. the page is working perfect...when u click Sumit...as we know..the page will be sumitted...then...i added my very very basic user control at the left of the page ( tables and cells and that stuff) ...run the page...click the Sumbit button (that was working one minute ago) and nothig happens...i tried EVERY THING...and nothing happened...i dont know why the button click event is not being fired !!!
everything is ok...the event handler exists...it is wired wiht on click event in intitalize component function...everything everything is Ok
I'm using VS.NET 2003 (ASP.NET 1.1)
Please guys help me asap
Thanks in advancecan you post some code please...
HTML and code behind
Thanks
Leketje
Please check whether you have handles the IsPostBack event.
The User Control
================
HTML
(%@. Control Language="c#" AutoEventWireup="false" Codebehind="Search.ascx.cs" Inherits="Controls.SearchbyName" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %)
(HTML)
(HEAD)
(LINK media="all" href="http://links.10026.com/?link=Controls\ControlsStyles.css" type="text/css" rel="stylesheet")
(/HEAD)
(body)
(form name="frmMain")
(table cellSpacing="0" cellPadding="0")
(tr)
(td)
(TABLE cellSpacing="0" cellPadding="0")
(TR)
(TD style="PADDING-LEFT: 4px" vAlign="top")
(asp:TextBox id="txtEmailAddress" Runat="server" Width="120px" CssClass="SRTextBox")(/asp:TextBox) (/TD)
(/TR)
(tr)
(TD style="PADDING-LEFT: 4px" vAlign="top" align="left")
(asp:TextBox id="txtPassword" Runat="server" Width="60px" CssClass="SRTextBox" TextMode="Password")(/asp:TextBox)
(/TD)
(/TR)
(TR)
(TD class="LeftPanelButton" style="PADDING-LEFT: 38px; PADDING-BOTTOM: 5px" align="right" colSpan="2")
(asp:Button id="btnLogin" Runat="server" Text="Login")(/asp:Button)
(/TD)
(/TR)
(/TABLE)
(/td)
(/tr)
(/table)
(/form)
(/body)
(/HTML)

Code Behind

namespaceMyNameSpace.Controls

{

using System;

using System.Data;

using System.Drawing;

using System.Web;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

///<summary>

/// Summary description for SearchbyName.

///</summary>

publicclass SearchbyName : System.Web.UI.UserControl

{

protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;

protected System.Web.UI.WebControls.TextBox txtPassword;

protected System.Web.UI.WebControls.Button btnLogin;

protected System.Web.UI.WebControls.TextBox txtEmailAddress;

protected System.Web.UI.WebControls.TextBox txtName;

privatevoid Page_Load(object sender, System.EventArgs e)

{

if(!IsPostBack)

{

}

}

#region Web Form Designer generated code

overrideprotectedvoid OnInit(EventArgs e)

{

//

// CODEGEN: This call is required by the ASP.NET Web Form Designer.

//

InitializeComponent();

base.OnInit(e);

}

///<summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

///</summary>

privatevoid InitializeComponent()

{

this.btnLogin.Click +=new System.EventHandler(this.btnLogin_Click);

this.Load +=new System.EventHandler(this.Page_Load);

}

#endregion

privatevoid btnLogin_Click(object sender, System.EventArgs e)

{

Response.Write("Help me please");

}

}

}

The web page
===========
HTML
(%@. Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication2.WebForm1" %)
(%@. Register TagPrefix="uc1" TagName="Search" src="http://pics.10026.com/?src=Search.ascx" %)
(!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" )
(HTML)
(HEAD)
(title)WebForm1(/title)
(meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1")
(meta name="CODE_LANGUAGE" Content="C#")
(meta name="vs_defaultClientScript" content="JavaScript")
(meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5")
(/HEAD)
(body)
(form id="Form1" method="post" runat="server")
(table)
(tr)
(td)
(uc1:Search id="Search1" runat="server")(/uc1:Search)
(/td)
(/tr)
(tr)
(td)
(asp:Button id="Button1" runat="server" Text="Button")(/asp:Button)
(/td)
(/tr)
(/table)
(/form)
(/body)
(/HTML)

Code Behind

using System;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

namespace WebApplication2

{

///<summary>

/// Summary description for WebForm1.

///</summary>

publicclass WebForm1 : System.Web.UI.Page

{

protected System.Web.UI.WebControls.Button Button1;

privatevoid Page_Load(object sender, System.EventArgs e)

{

// Put user code to initialize the page here

}

#region Web Form Designer generated code

overrideprotectedvoid OnInit(EventArgs e)

{

//

// CODEGEN: This call is required by the ASP.NET Web Form Designer.

//

InitializeComponent();

base.OnInit(e);

}

///<summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

///</summary>

privatevoid InitializeComponent()

{

this.Button1.Click +=new System.EventHandler(this.Button1_Click);

this.Load +=new System.EventHandler(this.Page_Load);

}

#endregion

privatevoid Button1_Click(object sender, System.EventArgs e)

{

}

}

}

================
I'm sorry for that HTML Crap...it seems i cant use the editor here !!!
Thanks in advance


Deepasmi, thanks...but the point is ...there is no post back !!!
i'm not waiting the button to do something and it didnt...no...the event is not fired at all !!
thanks

The reason why your button doesn't work is because you are including the <html> tags in your user control again...
The main idea of a user control is to create a HTML template with code behind to be included in the main page which already contains the <HTML><HEAD><BODY> and <FORM> tags.
Remove those tags in your user control and your button should work again.
Good Luck
Leketje


Thanks...thanks ...thanks :D:D:D...thaks Leketje...i passed more than 10 hours trying everything...again..thanks :)

Saturday, March 24, 2012

Please help ?

Hi,

We have complete ASP.net application in our local web server which was created on vb.net.

Now we want to make this application work in different server , basically hand over this application to another company ?

I am planning to ZIP the folder where my application contains, which includes BIN folder also. And also WEB.CONFIG file.

So, my question is , what are the things i should ask them, whether they have all these ??

As of i know, they should have W2K / XP, IIS , .NET framework .

Please advice me !

Thanks,

NicolRather than thinking along the lines of a "hand over", you might be better considering this a "deployment" of your ASP.NET application.

With that in mind,this MSDN article walks through the deployment of an ASP.NET app to a new server.

This MSDN article talks about deploying and distributing an application.

From a business point of view, you might want to refrain from saying to either your client or the other development company, "This is what you need." If you are wrong (and there are LOTS of things to consider), then they might come back to you and argue, "Yousaid that this is all we need, but it's not!"

You might be better served listing how you developed your application (eg, framework version, language, IIS version and configuration, development environment, database, commercial or free components you used ... that sort of thing). You can tell them, quite honestly, that there is no single "right configuration or environment" they need. Just illustrate what setup *you* used and state, quite reasonably, that you cannot guarantee it will work automatically on any other setup.

As to what you put on the CD, give them everything except any components you purchased. Give them one folder called "WORKING" with all your .vb components before compilation and unflattened photoshop files and so on, and another folder called "AS DEPLOYED" that you simply copy from your Inetpub/wwwroot folder (or wherever the real directory is).

One thing to consider, and I wouldn't presume to advise you on this ... but what about the rights to use the code? If you developed, say, an email component, are you able to use the same code for your next application? Can you use code for "common components" that are not "application-specific"?

Some things to think about, anyway ...