|
Can we design dynamic tabstrip control at runtime without creating tabstrip control at design time? Am trying to do it by adding
%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> at asp.net design page (.aspx)
and
Microsoft.Web.UI.WebControls.TabStrip tabControl = new Microsoft.Web.UI.WebControls.TabStrip();
at code behind.
Microsoft.Web.UI.WebControls.Tab tab=new Microsoft.Web.UI.WebControls.Tab();
tab.Text= " ok" ;
tab.ID = "1" ;
tabControl.Items.Add(tab);
Am not getting anything on page. Can somebody help???
rmr
|
|
|
|
|
You need to add the control to the Page's Control collection
Page.Controls.Add(tabControl);
regs
g00fy
|
|
|
|
|
Thanks for the reply.
But am not still able to get the tabcontrol. Please help
Design :
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
Code :
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Microsoft.Web.UI.WebControls.TabStrip tabControl = new Microsoft.Web.UI.WebControls.TabStrip();
Microsoft.Web.UI.WebControls.Tab tab=new Microsoft.Web.UI.WebControls.Tab();
tab.Text= " ok" ;
tab.ID = "1" ;
tabControl.Items.Add(tab);
Page.Controls.Add(tabControl);
}
-- modified at 10:20 Wednesday 6th September, 2006
rmr
|
|
|
|
|
ok i don't have that assembly and have never used it but this code works
protected void Page_Load(object sender, EventArgs e)
{
Table table = new Table();
table.Rows.Add(new TableRow());
table.Rows[0].Cells.Add(new TableCell());
table.Rows[0].Cells[0].Controls.Add(new LiteralControl("cell 0"));
Page.Controls.Add(table);
}
and this code doesn't work
protected void Page_Load(object sender, EventArgs e)
{
Table table = new Table();
table.Rows.Add(new TableRow());
table.Rows[0].Cells.Add(new TableCell());
table.Rows[0].Cells[0].Controls.Add(new LiteralControl("cell 0"));
}
hope that helps
g00fy
|
|
|
|
|
Hi Guys;
Here is the problem.
Im trying to Authenticate a user to my site but the function
User.Identity.IsAuthenticated always returns false
what could be the problem.
I also checked the web.config file with another project of mine which works fine there were no differences!!
Thanks in advance
Riazi
|
|
|
|
|
do you have authentication and roles and proviers set up in web.config?
do you have permission set up in web.config?
can you post your web.config?
regards,
g00fy
|
|
|
|
|
User.Identity works when you have passport credentials
a easy solution is to make a manual authentication of the user ID y password against to database, in true case you must to let pass the user, use the sentence e.Authenticated = true;
My project made that basic authentication, here the example
Logeo is the control's Login name
protected void Logeo_Authenticate(object sender, AuthenticateEventArgs e)
{
if ((Logeo.UserName == "a") && (Logeo.Password == "b"))
{
Mensaje.Text = "Welcome aboard";
e.Authenticated = true;
}
}
Keep Learning...
ff
|
|
|
|
|
britneyssssers wrote: User.Identity works when you have passport credentials
It is not only for Passport. Windows authentication also uses this. In fact I've never built a site that uses Passport authentication. Has anyone else? (I'm curous)
britneyssssers wrote: a easy solution is to make a manual authentication of the user ID y password against to database
An easy solution would be to use the built in functionality provided by the asp.net framework and add entries in the web.config to authenticate against. This is much easier than creating a database, tables and proceduces and the necessary overhead to use it.
only two letters away from being an asset
|
|
|
|
|
Hi all,
Any body know GOF Design patterns
Softy Boy
|
|
|
|
|
softy_boy wrote: Any body know GOF Design patterns
Yes.
|
|
|
|
|
lol colin,
yep me too.
g00fy
|
|
|
|
|
Yep, and a few others, like the Rube Goldberg pattern used by the last client.
only two letters away from being an asset
|
|
|
|
|
pls tell me on my mail id
g_parwez@rediffmail.com
g_parwez@yahoo.com
Softy Boy
|
|
|
|
|
Hi Friends,
I m using 1 session variable like this
Session["fullname"]="ABC";
then I pass this value to a class let say in which the FullName Property is declared with Public static key words
SessionInfo.FullName=Session[""].ToString();
It works fine for one user
but when i run two sessions what happens is
if Mr. "A" is already logged on the web site and after Mr. "A", Mr."B" logs in.
the name of Mr."A" changes to Mr."B" and on both browswer windows now name is Mr."B".
Would you please help me , where i am wrong?
Please if you do not understand my problem, do ask me.
thansk
Naveed Kamboh
|
|
|
|
|
the property is static, that is the problem
why do you not just access the session var, rather than store it in another class?
else you will need to get complicated, if you want to keep the property static and keep an IDictionary<sessionId, propertyValue> in the object and return the appropriate value for the users session.
other option, *cleaner* than static property, but less clean that just accessing session var, is to create an instance object for each session like.
new SessionInfo().FullName = Session["fullname"] as String;
hope this helps
g00fy
|
|
|
|
|
How can I change the color and style of an asp.net form?
Regards,
Thomas
|
|
|
|
|
|
How can I make an multilanguge application in asp.net ?
,,,,,,,,,,,,,,,,,,.................,,,,,,,,,,,,
|
|
|
|
|
|
|
Hi *.*,
I've got a user-control with 3 Dropdowns, A, B and C. If the user selects something in A, the content of B should change depending on the value selected in A. I sure could do that by reposting the page on every selection change. What I'd rather do is to send all possible values wrapped up in some javascript to the client. Can somebody give me a starting point on how to cope with this?
-> How do I attach Javascript to the Dropdowns change event?
-> How to send all values to the client?
thanks in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
i would use ajax for this, if this is not possible then look here,
http://javascriptkit.com/script/script2/multiplecombo.shtml
plenty of e.g's on that site
hope that helps,
g00fy
|
|
|
|
|
I am having a problem with a asp:menu 2.0 control. When I set up the control to use an XmlDataSource the postback event doesn't fire for all the menu items. i.e. I have a OnMenuItemClick event, but it only fires for the items under the first menu entry. Here is the aspx markup:
<asp:Menu ID="mnuMain" runat="server" Orientation="Horizontal" OnMenuItemClick="mnuMain_MenuItemClick" DataSourceID="xmldsMenu">
<DataBindings>
<asp:MenuItemBinding DataMember="MenuNode" NavigateUrlField="url" TextField="title" ValueField="value" />
<asp:MenuItemBinding DataMember="MenuNode" NavigateUrlField="url" TextField="title" ValueField="value" />
</DataBindings>
</asp:Menu>
<asp:XmlDataSource ID="xmldsMenu" runat="server" DataFile="menu.xml" XPath="/MapHomeNode/MenuNode">
</asp:XmlDataSource>
-- modified at 7:15 Wednesday 6th September, 2006
|
|
|
|
|
Hi there. What does your xml file look like?
|
|
|
|
|
hi all,
i am converting my custom control from a flow layout to a more configurable layout using div's (System.Web.UI.WebControls.Panel ). The control has a couple of buttons on it that work fine if i just render them within the custom control and not put them in another controls control collection.
As soon as i put the button/s into another controls control collection, the events dont fire. I have created a class WebPanel that extends Panel and implements INamingContainer but that doesn't help either. The same problem occurs also if I use a Table instead of a Panel
this is my overriden OnBubbleEvent
protected override bool OnBubbleEvent(object source, EventArgs e)
{
if (e is CommandEventArgs)
{
CommandEventArgs e1 = (CommandEventArgs)e;
Button button = source as Button;
OnClick(this, new ButtonEventArgs(button));
return false;
}
return true;
}
this is my overriden CreateChildControls
protected override void CreateChildControls()
{
Controls.Clear();
Button button = new Button();
button.Text = "Button1";
button.CommandArgument = "Button1";
this.Buttons.Add(button);
}
btw, this.Buttons is a custom ButtonCollection that has a ButtonAdded event, which adds the Button to the Controls collection
This renders & events fire
protected override void Render(HtmlTextWriter writer)
{
EnsureChildControls();
foreach (Button button in Buttons)
{
button.RenderControl(writer);
}
}
This renders & event *dont* fire
protected override void Render(HtmlTextWriter writer)
{
EnsureChildControls();
Panel container = new Panel();
Controls.Add(container);
foreach (Button button in Buttons)
{
container.Controls.Add(button);
}
container.RenderControl(writer);
}
Any ideas please.
g00fy
|
|
|
|