|
Thanks once again. Sometimes I wish to reply with as much knowledge as you show in your answers. I always look for your replies on the post
|
|
|
|
|
Hello,
I have a DropDownList that is used above a gridview to filter the results of the gridview when the user selects a "package" in the DDL.
I am programitically adding a zero index item "All Packages" to the list on page load.
Selection of any item in the list fires the SelectedIndexChanged event and successfully runs the code need to filter the results.
However when I select the zero index "All Packages" item, SelectedIndexChanged event does not fire.
Any help is greatly appreciated.
VS 2008 C#
Inside an Update Panel
FrontEnd Code:
<asp:dropdownlist id="ddlPackageSelect" visible="true" runat="server" autopostback="true" xmlns:asp="#unknown"></asp:dropdownlist>
Backend Code:
private void PopulatePackageDropDown()
{
using (StoredProcedure sp = new StoredProcedure("GetPackageDropDown", "celebro"))
{
try
{
DataSet gh = sp.GetDataSet();
ddlPackageSelect.DataSource = gh;
ddlPackageSelect.DataTextField = "Name";
ddlPackageSelect.DataValueField = "Id";
ddlPackageSelect.DataBind();
if (sp.RC == (int)ReturnCode.SUCCESS)
{
ddlPackageSelect.Items.Insert(0, new ListItem("All Packages", "0"));
}
}
catch (Exception e)
{
lblMessage.Text = e.Message;
}
}
}
private void InitializeComponent()
{
this.ddlPackageSelect.SelectedIndexChanged += new EventHandler(ddlPackageSelect_SelectedIndexChanged);
}
protected void ddlPackageSelect_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlPackageSelect.SelectedIndex == 0)
{
BuildGlobalStylesheetList();
}
else
{
BuildPackageStylesheetList(int.Parse(ddlPackageSelect.SelectedValue.ToString()));
}
StylesheetDetail.Visible = false;
}
|
|
|
|
|
I was able to solve this one on my own. The problem was that I was Populating the dropdown on page load everytime. Moving the population of this drop down into a conditional if(!IsPostBack) took care of the problem.
|
|
|
|
|
Please...It's Urgent.How can i dynamacially populate a Web treeview control with a parent and child level.And also identify the parent and child elements at click event.
|
|
|
|
|
If it's that urgent, would google not be a better place to start for this simple treeview style tutorial...
http://www.google.ie/search?rlz=1C1GGLS_en-USIE299IE303&sourceid=chrome&ie=UTF-8&q=populate+a+Web+treeview
|
|
|
|
|
When trying to send an excel file as an attachment the second time i got this error. I am saving the excel file in a folder on the server
P.S. The first time i send it normaly.
URL: /Transportation/TransportationForm.aspx?m=6&y=2008&t=send
Error Message: The process cannot access the file 'C:\web\Transportation\Attachments\TransportationForm-148.xls' because it is being used by another process.
Error Source: mscorlib
Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamWriter.CreateFile(String path, Boolean append) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) at Microsoft.VisualBasic.FileIO.FileSystem.WriteAllText(String file, String text, Boolean append, Encoding encoding) at Microsoft.VisualBasic.MyServices.FileSystemProxy.WriteAllText(String file, String text, Boolean append) at Library.AppEmailService.SendReport(Control report) at TransportationForm.ReportAction() at TransportationForm.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
|
|
|
|
|
Sounds like whatever you are doing the first time around, you are not releasing this excel file properly.
Are you building this excel file on the fly? Are you disposing of all your objects properly (look at using 'USING' blocks in your code)?
|
|
|
|
|
Iam using this code:
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"
HttpContext.Current.Response.Charset = ""
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
report.RenderControl(hw)
Dim userId As Integer = HttpContext.Current.Session("userId")
Dim attachment As String = HttpContext.Current.Server.MapPath("~\Attachments\TransportationForm-" & userId & ".xls")
My.Computer.FileSystem.WriteAllText(attachment, tw.ToString, False)
tw.Close()
hw.Close()
tw.Dispose()
hw.Dispose()
AppEmailService.SendMail(attachment)
Any Help
|
|
|
|
|
Hi,
I created a TextBox derivated class and I'd like to link it to a Label using a property, so here is what I need:
1) Create a property editor that shows a list of all available labels in the Page
2) Using the labels name, I need to get the UniqueID (ClientID), so I can use it with javascript.
Any tutorials about that?
Thanks,
Dirso.
|
|
|
|
|
hi,
Here is the code I've got so far, the ListBox works fine, but how do I populate it with the Labels? I can't access the Page object from it, right?
internal class LabelSelectTypeEditor : UITypeEditor
{
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
IWindowsFormsEditorService srv = null;
if (provider != null)
srv = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (srv != null)
{
System.Windows.Forms.ListBox lb = new System.Windows.Forms.ListBox();
lb.Items.Add("test1");
lb.Items.Add("test2");
srv.DropDownControl(lb);
return lb.Text;
}
return value;
}
}
Thanks,
Dirso
|
|
|
|
|
My goal is to create a property editor like the one available for the Label's AssociatedControlID.
|
|
|
|
|
i am getting whole html code in two line is there any way to get it back in previous form???? or in multiple lines?????
umerumerumer
|
|
|
|
|
Try pressing CTRL, K and D keys together.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
In Visual Studio, GoTo Edit -> Advanced ->Format Document.
Make sure all html tags have a closing tag, otherwise the document will not be formatted.
Hope this helps.
|
|
|
|
|
Highlight the code of interest (ctrl +A highlights all) right click and choose 'format selection'
|
|
|
|
|
Greetings,
Go to Visual Studio - Tools - Options - Environement - Keyboard, now for the first drop down list select Visual C# 2005 or make sure its selected, then on the Page you want to format Click Ctrl E, D this will reformat the page or any other document types in Visual Studio.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
i hav a dropdown lis t containing financial years.
i want the previous fiscal of selected fiscal.
Can anybody give me some idea.
I tried but i couldn't.
Please send me reply if u r free
tanks in adv.
Am using .net v1.1
kissy
|
|
|
|
|
can you be little detail about the scenario
Cheers!!
Brij
|
|
|
|
|
Hi,
There are four radiobutton(radiobuttonlist control) on selection of each radiobutton it will executed selectionchanged event to perform some code behind action.
How do we control radiobutton selection with keyboard down/up arrow in asp.net.
Could pls. suggest me how to implement this.
Send me any sample implementation which is pertinent to this requirement.
|
|
|
|
|
As always, to do anything with events on the client side involves writing javascript. ASP.NET really has nothing to do with it, you're sidestepping all the stuff that ASP.NET does to create some custom behaviour and hoping that your clients notice that your website behaves differently from any other, in a way that's not immediately obvious.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
|
hi i got web service who send me an xml Data in a web application, i want to merge the sent data in word model to generate a report
printed in client Side is there any tutorial to show how to proceed to do this, or what kind of documentation i must use.
thank you for you answer
|
|
|
|
|
If you want your client to print a word doc, you'll need to send it to them. Really, none of this question is to do with ASP.NET. You can control Word in C# tho using the Microsoft Tools for Office, and insert your data, creating a new document you'll need your user to open.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi
i developed a site and it is hosted in one server name "S1".
Database for this site and third party software "xyz" is maintained in another server name "S2".
now i want to add refernce of the third party software in a webpage and its object should be created at server "S2".
any time the user requests the page, the refernce should come thru server "s2" but not from the hosting server
plz help me
thanks in advance
vijay kumar D
|
|
|
|