|
Hello
I am developing application which creates text-box and check box at run time in asp.net using c#.I am adding checkbox n textbox to panel.
as
Checkbox chk=new Checkbox();
this.mypanel.controls.add(chk);
and text box as
Textbox txt=new Textbox();
this.mypanel.controls.add(txt);
by this check box get added successfully.
but when i am going to get the value of that check box n text box it by Find control then it give me error as "undefined".
So I want to access textboxes n checkboxes which r created runtime.
Swapnil Bhavsar
|
|
|
|
|
What does your sample code look like? The link below may give you some hints:
Accessing ASP.NET Controls Programmatically [^]
Also, make sure that you should readd the dynamic controls before the postback data is processed, otherwise they get lost, to learn more about this you can see the control life cycle in MSDN.
|
|
|
|
|
how to download file from server to client in asp.net web application
and i have to create new file in client machine folder from server code
|
|
|
|
|
|
hi everybody...
How can i embed external device into my application, is there any tutorial to read any steps to accomplish
external device like --> serviilenace cameras
thanks in advance
Hai this is fresh programer
|
|
|
|
|
IMHO, there are a couple of options that you can embed an external device in your web pages:
+ Your web page can host the device as an ActiveX control.
+ You can develop a window user control to host the device, then you can embed the control into your web pages, however the downside of this option is that the client side needs to have the .net framework in order for the windows control to work.
|
|
|
|
|
I have a problem. If I have a submenu item in a menu tree and it is not in the FIRST parent menu then it does not work BUT if I add this to the first menu it works in the first as well as any other menuitem I add this submenu too? ANY ideas?
I have a sub running to pickup a onmouseclick on the menuitems.
Sub onclick()
Does something
Menuitem1
Submenu item1
Submenu item2
Submenu item3
Menuitem2
Submenu item4
Submenu item5
Submenu item 1,2,3 works fine and on a mouse click on them the sub runs, but 4,5 does not do anyhting. IF I now do the following.
Menuitem1
Submenu item1
Submenu item2
Submenu item3
Submenu item4
Menuitem2
Submenu item4
Submenu item5
THEN Submenu item 4 works fine in both the Menuitem1 as well as Menuitem2 parents. Both works. I do not WANT Submenu item4 under Menuitem1 but if I do not have it there it does not work.
ANY ideas?
Here is the almost full page code. I had to ADD all the submenues to my first parent manu jsut to get it to work, but if I take them out none of the other parent manues submenues work at all.
----------------------------------------------------------------------------------------------
<%@ Page Language="VB" %>
<script language=vbscript runat="server">
Sub NavigationMenu_MenuItemClick(ByVal sender As Object, ByVal e As MenuEventArgs)
Dim MessageTransfer = e.Item.Value
'MsgBox(e.Item.Value)
'message.text = MessageTransfer
Response.Write("<input type='hidden' id='TestString' value=" & MessageTransfer & ">")
End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
</head>
<body bgcolor=white>
<!-- Place the Iframe with the top logo/banner and images here. -->
<iframe id="banner" src="images/headers/about.jpg" name="banner" frameborder="no" height="220px" width=100% scrolling=no></iframe>
<table width=100% cellpadding=0 cellspacing=0>
<tr width=100% align=left valign=top>
<td width=150>
<table cellpadding=0 cellspacing=0>
<tr>
<td>
<form id="form1" runat="server">
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#def7ff" DynamicHorizontalOffset="0" StaticPopOutImageUrl="~/popoutimage.gif"
Font-Size=Small Font-Names="Verdana" Font-Bold=true ForeColor="#2a70d6" StaticSubMenuIndent="0px" onmenuitemclick="NavigationMenu_MenuItemClick">
<Items>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Home" Value="home.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="About Us" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="History" Value="about/history.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Constitution" Value="about/constitution.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Executive" Value="about/executive.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Fellow and Honorary Members" Value="about/h_members.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Annual Report" Value="about/annual_report.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="AGM" Value="about/agm.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Why use an IO Psychologist" Value="about_profession/why.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Other professional Bodies" Value="about_profession/professional_bodies.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Statutory Requirements" Value="about_profession/statutory_requirements.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Online Registration" Value="conference/online_registration.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Call for papers" Value="conference/callforpapers.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Urgent" Value="news/urgent.asp" />
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Latest News" Value="news/latest.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Press Releases" Value="news/press.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Archives" Value="news/archives.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Why Join" Value="membership/whyjoin.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Membership Fees" Value="membership/fees.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Application Forms" Value="membership/application.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Gauteng" Value="regions/gauteng.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Western Cape" Value="regions/westerncape.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Kwa-Zulu Natal" Value="regions/kzn.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Advisory Committee" Value="committees/advisory.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Ethics" Value="committees/ethics.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Tariffs" Value="committees/tariffs.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Practice Framework" Value="committees/advisory.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Re-Classification of test" Value="committees/advisory.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Committee volunteer form" Value="committees/volunteer.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Continuing professional development CPD" Value="education_cpd/cpd.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Internship" Value="education_cpd/internships.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="National Board Exams" Value="education_cpd/exams.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Bursary" Value="research/bursaries.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Research Grants" Value="research/grants.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="About the Profession" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Why use an IO Psychologist" Value="about_profession/why.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Other professional Bodies" Value="about_profession/professional_bodies.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Statutory Requirements" Value="about_profession/statutory_requirements.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="News" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Urgent" Value="news/urgent.asp" />
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Latest News" Value="news/latest.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Press Releases" Value="news/press.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Archives" Value="news/archives.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Membership" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Why Join" Value="membership/whyjoin.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Membership Fees" Value="membership/fees.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Application Forms" Value="membership/application.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Regions" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Gauteng" Value="regions/gauteng.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Western Cape" Value="regions/westerncape.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Kwa-Zulu Natal" Value="regions/kzn.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Interest Groups" Value="interest_groups/assessment_centres.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Committees" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Advisory Committee" Value="committees/advisory.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Ethics" Value="committees/ethics.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Tariffs" Value="committees/tariffs.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Practice Framework" Value="committees/advisory.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Re-Classification of test" Value="committees/advisory.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Committee volunteer form" Value="committees/volunteer.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Education/ CPD" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Continuing professional development CPD" Value="education_cpd/cpd.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Internship" Value="education_cpd/internships.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="National Board Exams" Value="education_cpd/exams.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Research" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Bursary" Value="research/bursaries.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Research Grants" Value="research/grants.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Journals" Value="journals/index.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Events" Value="">
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Online Registration" Value="conference/online_registration.asp"/>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Call for papers" Value="conference/callforpapers.asp"/>
</asp:MenuItem>
<asp:MenuItem ImageUrl="~/frontbuttons.gif" Text="Contact Us" Value="contact/index.asp" />
</Items>
<StaticSelectedStyle BackColor="#2a70d6" />
<StaticMenuItemStyle HorizontalPadding="0px" VerticalPadding="0px" />
<DynamicMenuStyle BackColor="#def7ff" />
<DynamicSelectedStyle BackColor="#def7ff" />
<DynamicMenuItemStyle HorizontalPadding="0px" VerticalPadding="0px" />
<DynamicHoverStyle BackColor="#31ade9" Font-Bold="True" ForeColor="#ffffff" />
<StaticHoverStyle BackColor="#31ade9" Font-Bold="True" ForeColor="#ffffff" />
</asp:Menu>
</div>
</form>
</td>
</tr>
<tr>
<td>
<!-- Place the current IFRAME for the loggin and security menu here -->
<iframe id=LoginMenu frameborder=no src="" width="150px" height="300px" scrolling=no></iframe>
</td>
</tr>
</table>
</td>
<!-- the main frame where the different pages needs to be displayed -->
<td align=centre bgcolor="#31ade9">
<iframe id=MainIframe src="home.asp" height=550px width=100% marginwidth=0 frameborder=0 scrolling=auto></iframe>
</td>
</tr>
</table>
<%--<asp:Label ID=message runat=server></asp:Label>--%>
</body>
<script language="javascript">
//alert(TestString.value);
if(TestString.value != ""){
//alert(TestString.value);
MainIframe.location.replace(TestString.value);
}
</script>
<script language="vbscript">
'Place the session code here to determin what menu for logged in users to display.
Sub window_onload()
Dim PersonID
Dim Member
Dim AdminMenu
PersonID = "<%=Session("person_id")%>"
Member = "<%=Session("Member")%>"
AdminMenu = "<%=Session("AdminUser")%>"
if AdminMenu = "yes" then
top.document.all.LoginMenu.contentWindow.location = "AdminMenuFrame.asp"
elseif Member = "yes" then
top.document.all.MenuFLoginMenurame.contentWindow.location = "MemberMenuFrame.asp"
else
if Member = "no" then
top.document.all.LoginMenu.contentWindow.location = "GuestMenuFrame.asp"
else
top.document.all.LoginMenu.contentWindow.location = "Login.aspx"
end if
end if
End Sub
</script>
</html>
this is me
|
|
|
|
|
How do you attach the onclick client function to the treenode? Are you sure that the method is attached to the nodes that are not working as you said?
|
|
|
|
|
I found the problem.
My parents that does have children has all got values of "" and this does not work. Each parent and child need to have a unique value it seems. I set each parent with a unique value from 1 - 10 and simple check to see if the value from the selected menuitem is NOT a numeric value between 1 - 10 and if not then do the iframe src change.
I did not know that the parents values should be unique and should have values.
Thanks in any case. I am just glad it is working now. Must say took me ages to figure this out as I could find no help in telling me that this should be.
this is me
|
|
|
|
|
Can any one help me to display a calender using textbox and buttonclick,i need to use a pop-up calender in my form.ihave no idea how to do ths????I need exactly like,when we have a calender from webcontrols and when we try change properties there we find selected date.so when we click on perticular date it displays like that,
I need the same format in my application like that,Please try to give answer.
|
|
|
|
|
I think you can use client side scripting to popup a calender. I am new to ASP.NET but otherwise i would have used Javascript to do so.
Regards,
|
|
|
|
|
I would like to perform mouse click(right / single / double ) in a every node of an treeview control. But no such event is avail for this control. How can i perform this operation ?.
Jey
|
|
|
|
|
Hi there,
In this case, you can customise the TreeView control to do what you want. You can create a custom TreeNode as below and override the RenderPreText/RenderPostText method:
public class ExTreeNode : TreeNode
{
protected override void RenderPreText(HtmlTextWriter writer)
{
base.RenderPreText(writer);
writer.AddAttribute("onmouseover", "alert('hover me')");
}
} Also, to make the TreeView control work properly on postback, you may need to create a custom TreeView control by inheriting the built-in control and override the protected CreateNode method.
|
|
|
|
|
I currently using textbox with property multiple line, and i have write some text I want to break it into new line can insert into database.
Please help me?
................
|
|
|
|
|
Instead of text box try using Text Area.
|
|
|
|
|
You can set the TextMode property to multiline for a textbox.
Best Regards,
Apurva Kaushal
|
|
|
|
|
For some reason the new Linq for just does not work on my computer.
What I have installed:
SQL Server 2005 Express with default settings.
Visual Studio Web Developer 2005
Scott Gu's TagCloud linq example which you can find here:
http://weblogs.asp.net/scottgu/pages/Building-a-Photo-Management-Tagging-Site-using-ASP.NET-2.0_2C00_-LINQ_2C00_-and-Atlas.aspx
The Problem:
I tried to run Scott's example above but this error comes up whenever the program encounters "DataBind()" or if I try to use the sqlmetal command:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
This also happens with other linq related programs i run. Is there some setting I can change in SQL server to fix this? Thanks.
|
|
|
|
|
Hi there.
Do you enable the Name Pipes protocol for the Sql Express instance? You can find more hints from the link[^].
|
|
|
|
|
Hi
I've a dataset which retrieves an Image from table.
I want to bind it an imagebox. How to do it?
Thanks in advance.
Irshad
|
|
|
|
|
You can create another apx page and in the page load of this new aspx you can write this.
byte[] image = null;
image =(byte[])objDV[0]["imgImage1"];// Taking it from dataview/dataset/dtable
Response.ContentType = objDV[0]["strImage1ContentType"].ToString();
Response.BinaryWrite(image);
Assume this new aspx page name is ImageLoad.aspx
In your page where you are taking an Image control, call the method from aspx
page.
<asp:Image id=imgLogo runat="server" ImageUrl='<%#GetLogoURL(DataBinder.Eval(Container.DataItem,"intId"))%>' AlternateText='<%#DataBinder.Eval(Container.DataItem,"strName")%>'></asp:Image>
and in code behind you will have
protected string GetLogoURL(object objLogo)
{
return "ImgLoad.aspx"
}
"Walking on water and developing Software on a specification is easy, if
both are frozen..."
-- modified at 4:31 Tuesday 19th September, 2006
|
|
|
|
|
Can application use more than one web.config file. if yes than how will it identifies the default web.config?
|
|
|
|
|
Yes you can have more than one web.config file in an application, actually you can have separate config files for all the flders what you are having in your application. Normally if you are having config files in the folder it overrides the base web.config file.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Did any of you come across this type of issue...???
When sending EMail from ASP.NET application, for some domains mail is bounced back, as follows(this is coming only for some domains, not for all)
Subject: Spam Delivery Status Notification (Failure)
The following message to [recipientEmailAddress] was undeliverable.
The reason for the problem:
5.1.0 - Unknown address error 554-'5.5.2 Invalid data in message' EMail Body Format is HTML.
Email Body contains
1. strBody += "";
2. strBody += "....";
3. strBody += " \"sometext ... it's the only way to survive.\"";// in mail signature.
Thanks in advance.
-- modified at 13:58 Tuesday 19th September, 2006
|
|
|
|
|
Hi Folks,
I am having a ASP.NET Web Application developed on my friends PC on Visual tudio 2003. Now on my system, when i run it using IIS directly its working good. But when i run it using Visual Studio 2003 in debugging mode it is giving me this message: "Unable to start debugging on WebServer" and it doesn't start.
What is that which is not allowing me to start the applicatin in Debgging mode?
Thanks for your time and Help.
Karmendra
|
|
|
|
|
Check whether debugging is enabled or not?
Best Regards,
Apurva Kaushal
|
|
|
|