Hi Friend's ...
M new to c#.net, I have created a web control
library and made to dll file but when i invoked in a web project and
drag and draw that control is invisible here is that code can anyone
explain me how to use that and where i have made error .....
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
namespace samLibray
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:WebCustomControl1 runat=server>{0}:WebCustomControl1>")]
public class WebCustomControl1 : WebControl
{
public TextBox t1 = new TextBox();
public Button b1 = new Button();
public Label l1 = new Label();
[Bindable(true)]
[Category("Appearance")]
[DefaultValue("")]
[Localizable(true)]
public string Text
{
get
{
String s = (String)ViewState["Text"];
return ((s == null) ? String.Empty : s);
}
set
{
ViewState["Text"] = value;
}
}
protected override void RenderContents(HtmlTextWriter output)
{
output.Write(Text);
}
protected override void CreateChildControls()
{
l1.ID = "l1sam";
l1.BorderColor = System.Drawing.Color.Chocolate;
l1.Visible = true;
Controls.Add(l1);
Controls.Add(new LiteralControl("
"));
t1.ID = "t1sam";
t1.ForeColor = System.Drawing.Color.Azure;
t1.Visible = true;
Controls.Add(t1);
RequiredFieldValidator rf = new RequiredFieldValidator();
rf.ID = "rfsam";
rf.ErrorMessage = "Values Needed";
rf.ControlToValidate ="t1sam";
rf.Visible = true;
Controls.Add(rf);
Controls.Add(new LiteralControl("
"));
b1.ID = "b1sam";
b1.ForeColor = System.Drawing.Color.Blue;
//buttonCell.Width = Unit.Pixel(1);
b1.Width = Unit.Pixel(1);
b1.Visible = true;
Controls.Add(b1);
Controls.Add(new LiteralControl("
"));
EnsureChildControls();
}
protected override void OnInit(EventArgs e)
{
l1.Text = "Enter Data";
b1.Text = "Submit";
base.OnInit(e);
}
private void b1sam_Click(object sender, EventArgs e)
{
}
}
}
Tks in Adv...
G.sam...
Loading
sam calebPosted Apr 15, 2009, 5:59 AM
sam calebPosted Apr 15, 2009, 5:59 AM
sam calebPosted Apr 9, 2009, 4:44 AM
LisaPosted Mar 30, 2009, 7:38 AM
sorry was on vacation so cudnt reply back.
did you get it working..??
Thanks,
lisa
LisaPosted Mar 30, 2009, 7:38 AM
sorry was on vacation so cudnt reply back.
did you get it working..??
Thanks,
lisa
sam calebPosted Feb 20, 2009, 4:28 AM
Can u say how to Segment texts from a image using c#.net ....
Tks in Adv....
G.Sam....
sam calebPosted Feb 20, 2009, 12:00 AM
Actually i Want to create a own dll file for User Registration .... So i didn't need a lot of Complex code i need a simple model code for how to create a own dll and invoke into my Website project....
Tks in Adv...
G.Sam...
sam calebPosted Feb 19, 2009, 9:17 AM
Actually i Want to create a own dll file for User Registration .... So i didn't need a lot of Complex code i need a simple model code for how to create a own dll and invoke into my Website project....
Tks in Adv...
G.Sam...
LisaPosted Feb 19, 2009, 8:18 AM
sorry looks like i misspelled .ascx as .acmx (working on lot of webservices these days :) )
what are you actually looking for, if you can brief it out i think i can be more helpful.
Thanks,
Lisa
sam calebPosted Feb 19, 2009, 6:48 AM
Can u Give me Simple Code for web control library .....
Tks in Adv...
G.Sam...
LisaPosted Feb 19, 2009, 5:26 AM
then you can use it as custom component rather you need to create the component dynamically at runtime. unless you have anyother problem creating a static control , i suggest you create a .acmx file so as can be used as a custom component and can be draged and drop anywhere in your application.
Thanks,
Lisa
sam calebPosted Feb 19, 2009, 4:19 AM
No i have created as WebCustomControl1.cs not in .ascx ....
Tks in Adv...
G.Sam....
LisaPosted Feb 19, 2009, 2:58 AM
did you create this as a class file or a .acmx file ?
Thanks,
Lisa