Hi yahz everyone. I currently trying using vb c# to do a login coding/form. but i couldn't do any checking on it. I using web part template to do a member login. Anyone able to help me? i have did something out from it but not too sure able to work. Can anyone lend a hand?
i did some coding like this:
-------------------------------------------------------------------------
namespace MemberLogin
{
/// <summary>
/// Description for WebPart1.
/// </summary>
[DefaultProperty("Text"),
ToolboxData("<{0}:WebPart1 runat=server></{0}:WebPart1>"),
XmlRoot(Namespace="MemberLogin")]
public class WebPart1 : Microsoft.SharePoint.WebPartPages.WebPart
{
private string ID;
private string pwd;
// Declare variable for HtmlControls user interface elements
HtmlButton _mybuttonClear;
HtmlButton _mybuttonSubmit;
HtmlButton _mybuttonDisplay;
HtmlInputText _mytextboxid;
HtmlInputText _mytextboxpwd;
//Event handler for clear button
public void _mybuttonClear_click (object sender, EventArgs e)
{
_mytextboxid.Value="";
_mytextboxpwd.Value="";
}
//Event handler for submit button
public void _mybuttonSubmit_click (object sender, EventArgs e)
{
id = _mytextboxid.Value;
pwd = _mytextboxpwd.Value;
if ((id = "abc") && (pwd="abc"))
{
_mybuttonDisplay.InnerText="Hello";
}
else
{
_mybuttonDisplay.InnerText = "Not Hello";
}
}
[Browsable(true),
Category("Miscellaneous"),
DefaultValue(defaultText),
WebPartStorage(Storage.Personal),
FriendlyName("Text"),
Description("Text Property")]
public string Text
{
get
{
return text;
}
set
{
text = value;
}
}
protected override void RenderWebPart(HtmlTextWriter output)
{
output.Write(SPEncode.HtmlEncode(Text));
}
}
-------------------------------------------------------------------------