|
Dear Friends,
I want to generate controls Textbox, Checkbox, Label etc... programaticaly.. pls help me
Dear Friends.....
Haridas.R
harisofttech@gmail.com
harisofttech@hotmail.com (online)
harizeenet@yahoo.co.in(online)
"Achievement is not a destination, its a journey "
|
|
|
|
|
do one thing
use placeholder control where you want to display.
create conrols
ex:
TextBox txtName = new TextBox();
txtName.Name = "txtName";
Add to the placeholder conrtol.
placeholder1.Conrols.Add(txtName);
whenever u dont want remove or Hide
//Removing
placeholder1.Conrols.Remove(txtName);
regards
GV Ramana
|
|
|
|
|
Thanks for the infromation...
Haridas.R
harisofttech@gmail.com
harisofttech@hotmail.com (online)
harizeenet@yahoo.co.in(online)
"Achievement is not a destination, its a journey "
|
|
|
|
|
Generating controls is possible but mainting the state is tricky. If you can't use a dataRepeater (even with your own custom XML or dataset) or gridview you may have to.
<br />
TextBox txt = new TextBox();<br />
txt.Text = "Dynamically added to Page";<br />
this.Controls.Add(txt);<br />
You will find that the value in the control will disappear on each postback.
Please refer to this link for more information about the page lifecycle.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Thanks for the information,
How we can manage this State.. pls inform me
Haridas.R
harisofttech@gmail.com
harisofttech@hotmail.com (online)
harizeenet@yahoo.co.in(online)
"Achievement is not a destination, its a journey "
|
|
|
|
|
hi there,
i'd downloaded a code for FileBroserDialog in asp.net from this site.i works fine when run under visual studio .but when i browse the app and run this utility the dialog never opens thereby giving time out error. any ideas.please
forward aternative code if possible. thanx.
current code::
Shell32.Shell picker = new Shell32.ShellClass();
Shell32.Folder folder = picker.BrowseForFolder(0, "Select Folder", 0, 0); //picker.BrowseForFolder((int)this.Handle, "Resource Updater", 0, 0);
if (folder == null)
{
return; //user hit cancel
}
Shell32.FolderItem fi = (folder as Shell32.Folder3).Self;
strDownloadPath = fi.Path;
|
|
|
|
|
Shell32 is running on your server, not in the browser. Are you wanting to allow users to upload a file via a web application? The only thing you can do is use the html file input control.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi all,
I'm trying to set up my web app so that it doesn't display error/debugging/tracing messages to visitors.
I have already tried the following but i still get the Description:, Exception Details:, Parameter name:, Source Error: etc that you get from the debugger
My Web.Config has:
<trace enabled="false" pageoutput="false"> <compilation debug="false" explicit="false">
No pages have the debug set to true.
IIS has clientside debugging disabled.
Any ideas on how i can sort this out?
Thanks in advance.
|
|
|
|
|
hi Orb1t,
If you try below code in to web.config file and check that
<trace enabled="true" requestlimit="20" pageoutput="false"
="" tracemode="SortByTime" localonly="false">It is working but incase it is not work then try to flase tracing at page level like below:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Trace.aspx.vb"
Inherits="MCSDWebAppsVB.Trace" trace="True" %>
chetan Visodiya
-- modified at 8:05 Thursday 3rd August, 2006
Chetan visodiya
|
|
|
|
|
Chetan, Thanks for your reply + suggestions. I've tried both of them but had no luck with it, the server still returns the parser errors.
Any other ideas?
Cheers
|
|
|
|
|
I think what you are trying to do is set up custom errors. Turn the <customerros mode="On" defaultredirect="YouErrorPage.aspx">
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Thanks ToddHileHoffer, this is exactly what i want to do.
I just wondered whether there might be a way in which i could get it to use IIS' defualt script message'An error occurred on the server when processing the URL. Please contact the system administrator.' and avoid having to create customs + have the 302 redirects.
|
|
|
|
|
Turn the
<br />
customErrors mode = "On" defaultRedirect="YouErrorPage.aspx"<br />
<br />
/customErrors<br />
<br />
it appeared ok in the preview. Some wierd html thing made the tags invisible.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
i need source code to play audio files using asp.net 1.1/c#
danny
|
|
|
|
|
try this
using System.Runtime.InteropServices;<br />
<br />
public class Sound<br />
{<br />
[DllImport("winmm.dll")]<br />
protected static extern bool PlaySound(string lpszName, int hModule, int dwFlags);<br />
protected const int SND_FILENAME = 0x20000;<br />
protected const int SND_ASYNC = 0x1;<br />
<br />
public static void Play(string audioFullpath, int minSeconds)<br />
{<br />
DateTime now = DateTime.Now; <br />
TimeSpan ts = now.Subtract(lastPlayed);<br />
if (ts.TotalSeconds > minSeconds)<br />
{<br />
PlaySound(audioFullpath, 0, SND_ASYNC | SND_FILENAME);<br />
lastPlayed = now; <br />
}<br />
}<br />
}<br />
<br />
Sound.Play(@"c:\sample1.wav",30);
regards
GV Ramana
|
|
|
|
|
I have to provide download of files in ASP.NET 2.0
I am using following lines of code.
try
{
Byte [] bytes = this.ContentController.GetFileContents(filePath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=File" + _fileExtension);
Response.AddHeader("Content-Length", bytes.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.Buffer = true;
Response.BinaryWrite(bytes);
Response.Flush();
}
catch(FileNotFoundException fnfe)
{
this.ShowErrorMessage(this.GetErrorString(ResourceIdentifiers.DOCUMENT_FILE_NOT_FOUND_ERROR));
}
catch(Exception ex)
{
this.ShowErrorMessage(this.GetErrorString(ResourceIdentifiers.DOCUMENT_UNEXPECTED_ERROR));
}
Using above code, when one clicks on file link, a default download box of IE appears. If user clicks on Save, the file gets saved on disk and user can open that file. If user clicks on Open, it opens registered application with file type and says, file not found. Using same code I am able to open Word file but I cannot open Excel, PDF files.
Note: My application used Master pages, UIP Application Blocks. The code written above is inside a user control which gets loaded on view (webform) dynamically based on configration(xml) file.
Please can anyone suggest what could be going wrong in the piece of code because of which I am not able to open Excel/PDF files.
Apprciate your help.
Thanks and regards,
Ashish
|
|
|
|
|
Response.ContentType = "application/vnd.ms-excel"
Response.ContentType = "application/pdf"
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
ToddHileHoffer, thanks for your help.
I am still the same problem. Could anything else you can think of to getrid of this problem
- ashish
|
|
|
|
|
VB.NEt code that works from my old application.
' The following code writes the pdf file to the Client’s browser.
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname) 'String location of the file
Response.Flush()
Response.Close()
'delete the exported file from disk
System.IO.File.Delete(Fname)
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Seems I get the problem when I use UIPAB. Otherwise the same code works fine.
Any idea what UIPAB does different.
- ashish
|
|
|
|
|
Hi,
I want to make http request for html page of other site in .aspx page of my site. This html page contain frames. I am using webrequest object to request this html page. When I checked the output string of Request.GetResponse.GetResponseStream it contain the html code of the page i.e etc. and not the actual output. Due to this, .aspx page display complete blank output. The code written to call this frame page is as follows.
Request = WebRequest.Create(URL)
'Request.Timeout = 10000
'Request.ContentLength = body.lenth
Request.ContentType = "application/x-www-form-urlencoded"
Request.Method = "POST"
'Request.AllowAutoRedirect = True
ItemStream = Request.GetResponse.GetResponseStream
Dim tr As StreamReader = New StreamReader(ItemStream)
_Result = tr.ReadToEnd
Note : URL is the html page which contain frame and reside on some other server.
Kindly let me know how to request frame page using webrequest object or any other method.
Regards
Nilesh
|
|
|
|
|
If you want the contents of the frames, you have to parse the page that you got to get the URL:s for the frames, so that you can request them from the server.
---
b { font-weight: normal; }
|
|
|
|
|
A project in .NET 2.0 C#. I have used the calendar to let user select the start date. However I do not know how to calculate the end date if the duration is 3 months after clicking the submit button. The end date will be displayed at the lblEndDate.
<br />
public DateTime strEnd; <br />
protected void Calendar1_SelectionChanged(object sender, EventArgs e)<br />
{<br />
txtStartDate.Text = Calendar1.SelectedDate.ToString("dd MMM yyyy");<br />
}<br />
protected void btnStart_Click(object sender, EventArgs e)<br />
{<br />
}<br />
thanks in advance. Much appreciated.
|
|
|
|
|
Inspite of using adddays you can use addmonths which requires no. of monts as a parameter.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks you ring something to me. I still insist on using days. And it can work. Thanks Apurva Kaushal.
lblEndDate.Text = Calendar1.SelectedDate.AddDays(81).ToString("dd MMM yyyy"); // subtract 3 days because I want to end on a friday
Loving Code Project
|
|
|
|