|
Hi,
I have created some dynamic controls in page load and added to an existing asp:Table
Its displaying in the page ( the page contains 3 tabs , this controls are added in one of the tab)
If I click on another tab , I am trying to save the data in this dynamic controls .
But not able to access it.
Code
This panel is a part of one table.
<asp:Panel ID="pStudySpecific" runat="server" EnableViewState="true" >
<%--<table width="100%" > --%>
<tr>
<td>
<asp:Table width="100%" border="1" runat="server" id="tblTimeZone" enableviewstate="true" >
<asp:TableRow>
<asp:TableCell>
<asp:Table ID="tblTimeZones" runat="server" border="0" EnableViewState="true" >
<asp:TableHeaderRow HorizontalAlign="Left">
<asp:TableHeaderCell HorizontalAlign="Left">
<asp:Label runat="server" ID="lblTimeZoneDetails" Text="TimeZone" SkinID="GroupTitleSkin"></asp:Label>
</asp:TableHeaderCell>
</asp:TableHeaderRow>
</asp:Table>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</td>
</tr>
</panel>
1. page load create controls and added to tblTimeZones.
2.Tab( link button click event)
I tried to access control
ContentPlaceHolder cphDetails = (ContentPlaceHolder)this.Master.FindControl("cphDetails");
Table tblTimeZon = (Table)cphDetails.FindControl("tblTimeZones");
till here its fine ,I am getting the values.
DropDownList drpLstControl = (DropDownList)tblTimeZon.FindControl("drpLst" + objCustomField.DatabaseField);
In the above line its giving null value.
This all controls are in an update panel and content place holder.
Please help.
|
|
|
|
|
Hi,
One important thing i noticed was you need to traverse through rows and then cells in tblTimeZon table. And then try to find the control in a particular cell.
Here is a small example, i will be using a TextBox.
.aspx code
<asp:Table ID="Table1" runat="server" Height="160px" Width="176px">
<asp:TableRow runat="server" ID="ROW1">
<asp:TableCell runat="server" ID="CELL1">
aaa
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</asp:TableCell>
<asp:TableCell runat="server">bbb</asp:TableCell>
<asp:TableCell runat="server">ccc</asp:TableCell>
</asp:TableRow>
</asp:Table>
<asp:Button ID="Button1" runat="server" Text="Get Content in Text" OnClick="Button1_Click" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
.cs code
protected void Button1_Click(object sender, EventArgs e)
{
foreach (TableRow tr in Table1.Rows)
{
foreach (TableCell tc in tr.Cells)
{
TextBox tb = (TextBox)tc.FindControl("TextBox1");
if(tb != null)
{
Label1.Text = tb.Text;
}
}
}
}
Hope it helped.
Thx,
Gayani
|
|
|
|
|
thaks for the reply ,
But i am adding 4 rows in to the table,after postback( link button click ) no rows are there in the table.
The controls are lost.
Please help.
|
|
|
|
|
I am trying to install the ajax control toolkit...
Downloaded the toolkit .sln and I would like to build the Template VSI project before installation.
This is the error I get during build:
Could not load file or assembly 'vjslib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I am using VS 2008 under windows xp x64
Any thoughts on how to resolve this issue please?
Thanks
|
|
|
|
|
|
Hi all,
In my web application,user(in admin part) can enter video or audio files and when a user clicks(in End user part) on the uploaded filename the file should play.How can i do this?
Thanks in advance.
|
|
|
|
|
Hi i had a question about the Web Application project that i wanted to change the folder location.
but i try to open the project i get a error message:
"Visual Studio .NET Cannot create or open the application, The likeliest problem is that required components are not installed on the local web server
run visual Studio .Net setup and add the web Development Component."
before i move the web application project file it can be launch the Web project.
Pls help me!!!
|
|
|
|
|
Are you moving the folder from a local server to a web server?
Can you give us more detail about what you are doing
|
|
|
|
|
Thank you for your reply
actualy what i need to do is move the web application(source Code) from "C:\Inetpub\wwwroot" to "C:\Inetpub\wwwroot\NewProject" i can move the web Application(source Code) and lanuch the web application but the only problem is i can't open the web Application(source Code) with Visual Studio 2003 with error message as above.i found that the Visual Studio 2003 still point to old folder.
|
|
|
|
|
Hi All,
I've a image gallery website where members can upload and restrict the access to few friends. The problem is, images are directly accessible from browser. How could I restrict specific folder to accessible from aspx pages only.
Regards,
Neeraj
|
|
|
|
|
I have done similar to this..
I have used a webservice to get the path of the requested images from an encrypted session guid which is created during login...
Abhishek Sur
|
|
|
|
|
Thanks for the reply. When I show image, anybody can check the relative path from viewsource and try other photos from same folder. Please correct me if I'm wrong or I understood your reply wrongly.
Rgds,
Neeraj
|
|
|
|
|
Neeraj Arora wrote: How could I restrict specific folder to accessible from aspx pages only
Write a http handler which handles requests for images. Check the authentication and display necessary messages. Make sure you map the extensions to ASP.NET in IIS settings.
|
|
|
|
|
Thanks for reply but I'm not aware how to write this type of handler. Could you help me for a sample.
Rgds,
Neeraj
|
|
|
|
|
|
|
There are two ways of doing this - an easy "hack" and a "proper" way...
The easy way is simply to save your images with randomly assigned (GUID-type thing) filenames which can't be guessed. This doesn't stop people linking directly to your images once they know the filename of course, but unless your images are highly popular that is unlikely to be a problem, but it will stop them from finding images until you reveal the address.
The proper way is to write a custom handler; you can find an example here[^]. Note though that depending on your version of IIS you may need to perform some steps differently - that article assumes IIS6; once you get above this you need to write your config file differntly, for one thing...
|
|
|
|
|
hi all
i have created a form for printing of sale bill.
when user create a bill a voucher number is generated. i pick that voucher number and generate its printing. while generating the printing i m creating a html for the printing and storing that html in string.
when the all html is genearated i pass that string to another page where a javascript function is called. A pop up populate and user click on print button
but now i want this printing for 10 - 20 voucher number(means continous printing). the problem is if i generate html for 10-20 voucher then i take too much time.
i dont know to do this.
any suggestion
Er. Jagwinder Singh
|
|
|
|
|
Webapplications are not suitable for what you are trying to do. Consider changing your design.
|
|
|
|
|
i have all builded the application now how i can change its design
Er. Jagwinder Singh
|
|
|
|
|
I am using COM DLL (Which is developed in VB) in .Net to fill the Schools Name in Dropdown list but it is not filling (it is giving this error: Server Threw an Exception: RPC_E_SERVERFAULT’). In development machine it is working fine and we have another product which is not using this COM DLL that application also working fine. It seems COM DLL having some issue with Network Path
Our Product installed in Windows 2003, which is running IIS 6.0 in the same machine but our Data (Contains collection of Files) is other machine (Jai-XP PC). Both the machines are connected under one
Domain controller.
In IIS under Directory Security I gave domain user ID and password and i gave the same user for data also.
How we can solve Interop services in domain controller environment.
I hope somebody will resolve...
Thanks & Regards,
Jai Sankar N.
|
|
|
|
|
simple example :- i have problem in this code how can i remove.
<body>
<form id="form1" runat="server">
<div>
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
</asp:scriptmanager>
<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
<asp:updatepanel id="UpdatePanel2" runat="server" childrenastriggers="False">
UpdateMode="Conditional">
<contenttemplate>
<asp:fileupload runat="server" id="fu1" />
</contenttemplate>
<triggers>
<asp:asyncpostbacktrigger controlid="btn" eventname="Click" />
</triggers>
</asp:updatepanel>
<asp:button runat="server" id="btn" text="ok" onclick="btn_Click" width="41px" />
</contenttemplate>
</asp:updatepanel>
</div>
</form>
</body>
protected void btn_Click(object sender, EventArgs e)
{
string str11 = fu1.FileName;
if (fu1.FileName != "")
{
string str = "~/images/photo/";
str = Server.MapPath(str);
str = str + "a" + ".jpg";
}
}
str11 have nothing while select a file and first update panel is also necessary for my code. please solve my problem?
I will do my best?
|
|
|
|
|
Try this:
put fileupload control and button in two separate update panel and updatemode always.
Cheers!!
Brij
|
|
|
|
|
<form id="form1" runat="server">
<div>
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
</asp:scriptmanager>
<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
<asp:updatepanel id="UpdatePanel2" runat="server" childrenastriggers="False">
UpdateMode="Conditional">
<contenttemplate>
<asp:fileupload runat="server" id="fu1" />
</contenttemplate>
<triggers>
<asp:asyncpostbacktrigger controlid="btn" eventname="Click" />
</triggers>
</asp:updatepanel>
<asp:updatepanel id="UpdatePanel3" runat="server">
<contenttemplate>
<asp:button runat="server" id="btn" text="ok" onclick="btn_Click" width="41px" />
</contenttemplate>
</asp:updatepanel>
</contenttemplate>
</asp:updatepanel>
</div>
</form>
as u told me i do this but not work.
I will do my best?
|
|
|
|
|
Can you show me where is the Closing tag of update panel
Cheers!!
Brij
|
|
|
|