Click here to Skip to main content
15,890,512 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionTableAdapter info Pin
robert11029-Sep-06 7:40
robert11029-Sep-06 7:40 
AnswerRe: TableAdapter info Pin
Not Active29-Sep-06 7:58
mentorNot Active29-Sep-06 7:58 
AnswerRe: TableAdapter info Pin
sanju027629-Sep-06 9:34
sanju027629-Sep-06 9:34 
Questionphp Pin
amaneet29-Sep-06 6:39
amaneet29-Sep-06 6:39 
AnswerRe: php Pin
nguyenvhn29-Sep-06 16:24
nguyenvhn29-Sep-06 16:24 
Questionphp Pin
amaneet29-Sep-06 6:25
amaneet29-Sep-06 6:25 
AnswerRe: php Pin
Not Active29-Sep-06 7:35
mentorNot Active29-Sep-06 7:35 
QuestionWeb Control Designing Questions Pin
Xiaoming Qian29-Sep-06 4:41
Xiaoming Qian29-Sep-06 4:41 
I had write a WebControl and its designer.The following is som of my code
<br />
[Designer("SM.WebControls.PagingControlDesigner"),<br />
 ParseChildren(false)]<br />
public class PagingControl : System.Web.UI.WebControls.WebControl,INamingContainer<br />
{<br />
   [Bindable(true),<br />
    EditorAttribute(typeof(UrlEditor), typeof(UITypeEditor))] <br />
   public string FirstButtonImg<br />
   {<br />
      get{return Convert.ToString(ViewState["FirstButtonImg"]);}<br />
      set{ViewState["FirstButtonImg"] = value;}<br />
   }<br />
 <br />
   protected PlaceHolder ParsedSubObjectContainer = new PlaceHolder();<br />
   protected override void CreateChildControls()<br />
   {<br />
       Panel Panel1 = new Panel();<br />
       Create some Controls and add to Panel1<br />
       Controls.Add(Panel1);<br />
       Controls.Add(ParsedSubObjectContainer);<br />
   }<br />
   protected override void AddParsedSubObject(Object obj)<br />
   {<br />
       ParsedSubObjectContainer.Controls.Add((Control)obj);<br />
   }<br />
<br />
   internal string GetDesignTimeHtml()<br />
   {<br />
      EnsureChildControls();<br />
      StringWriter sw = new StringWriter();<br />
      HtmlTextWriter writer = new HtmlTextWriter(sw);<br />
      this.RenderControl(writer);<br />
      return sw.ToString();<br />
   }<br />
   ...<br />
}<br />
public class PagingControlDesigner : ControlDesigner<br />
{<br />
   public override bool DesignTimeHtmlRequiresLoadComplete<br />
   {<br />
  	get{ return true;}<br />
   }<br />
<br />
   private PagingControl PagingControlInstance;<br />
<br />
   public override void Initialize(System.ComponentModel.IComponent component)<br />
   {<br />
      this.PagingControlInstance = (PagingControl) component;<br />
      base.Initialize (component);<br />
   }<br />
<br />
   public override string GetDesignTimeHtml() <br />
   {<br />
      return PagingControlInstance.GetDesignTimeHtml();<br />
   }<br />
   ...<br />
}<br />


I faced two problems when I writing this WebControl.
The First is when I try to bind the FirstButtonImg property in a web form, the expression is not evaluated.It simple pass the '<%= Expression %>' string to the property
<br />
<SM:PagingControl id="PagingControl1" runat="server" <br />
  FirstButtonImg='<%= Expression %>'<br />
><br />

I do call PagingControl1.DataBind() in my WebForm's code.

The second, when I am designing a WebFrom:
<br />
<SM:PagingControl id="PagingControl1" runat="server"><br />
 <asp:DataGrid id="DataGrid1" runat="server"><br />
 </asp:DataGrid><br />
</SM:PagingControl><br />

Only the Panel(Panel1) is displayed in the designer.But the ParsedSubObjects(here is DataGrid1) is not displayed.How can I get the ParsedSubObjects'(here is DataGrid's) DesignTimeHTML to display it in the designer.

Can any one help me? Any idea will be appropriate.
QuestionKeeping focus on control after postback?? Pin
Goalie3529-Sep-06 3:54
Goalie3529-Sep-06 3:54 
AnswerRe: Keeping focus on control after postback?? Pin
postmaster@programmingknowledge.com29-Sep-06 4:48
postmaster@programmingknowledge.com29-Sep-06 4:48 
AnswerRe: Keeping focus on control after postback?? Pin
Not Active29-Sep-06 5:38
mentorNot Active29-Sep-06 5:38 
AnswerRe: Keeping focus on control after postback?? Pin
amaneet29-Sep-06 6:29
amaneet29-Sep-06 6:29 
GeneralRe: Keeping focus on control after postback?? Pin
Not Active29-Sep-06 7:32
mentorNot Active29-Sep-06 7:32 
QuestionGridView RowCommand Pin
John Gathogo29-Sep-06 3:24
John Gathogo29-Sep-06 3:24 
AnswerRe: GridView RowCommand Pin
Sathesh Sakthivel29-Sep-06 3:49
Sathesh Sakthivel29-Sep-06 3:49 
AnswerRe: GridView RowCommand Pin
Kschuler29-Sep-06 11:08
Kschuler29-Sep-06 11:08 
Questionmailto: Issue Pin
Brendan Vogt29-Sep-06 2:34
Brendan Vogt29-Sep-06 2:34 
AnswerRe: mailto: Issue Pin
Paddy Boyd29-Sep-06 2:47
Paddy Boyd29-Sep-06 2:47 
QuestionAccess Data Source > Loop Pin
shapper29-Sep-06 2:24
shapper29-Sep-06 2:24 
AnswerRe: Image refresh in a page Pin
albCode29-Sep-06 2:42
albCode29-Sep-06 2:42 
QuestionImage refresh in a page Pin
Uma Kameswari29-Sep-06 2:19
Uma Kameswari29-Sep-06 2:19 
AnswerRe: Image refresh in a page Pin
Sathesh Sakthivel29-Sep-06 2:41
Sathesh Sakthivel29-Sep-06 2:41 
GeneralRe: Image refresh in a page Pin
Uma Kameswari29-Sep-06 2:46
Uma Kameswari29-Sep-06 2:46 
GeneralRe: Image refresh in a page Pin
Sathesh Sakthivel29-Sep-06 2:54
Sathesh Sakthivel29-Sep-06 2:54 
AnswerRe: Image refresh in a page Pin
Paddy Boyd29-Sep-06 2:53
Paddy Boyd29-Sep-06 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.