|
I have used COM+ components from asp.net, anyways I looked it up...and found this nice articl. Hope it helps
href="http://www.aspheute.com/english/20000828.asp">http://www.aspheute.com/english/20000828.asp[^]
|
|
|
|
|
Hi,
I'll take a look at it.
Thanks.
ALMC
|
|
|
|
|
Dear all, I am having trouble with generating Excel when the application is placed on a webserver. Locally, it works fine but unfortunately, it gives the following error message when placed on a webserver. Actually, I am reading each node in a Treeview for generating the Excel. I am using the Microsoft Excel Object 11.0 as reference and the classes in there (Application, Workbook, Sheets...) Please help me in resolving this problem if possible.
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error:
80080005.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error:
80080005.
Source Error:
Line 241: // Excel objects initialisation
Line 242: GC.Collect();// clean up any other excel guys hangin'
around...
Line 243: oXL = new Excel.Application();
Line 244: oXL.Visible = false;
Line 245:
Source File: c:\TrouxLicenses\Default.aspx.cs Line: 243
Stack Trace:
[COMException (0x80080005): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005.]
_Default.GenerateExcel() in c:\TrouxLicenses\Default.aspx.cs:243
_Default.btnExportToExcel_Click(Object sender, EventArgs e) in
c:\TrouxLicenses\Default.aspx.cs:209
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
|
|
|
|
|
|
Hey all,
I'm trying to get an application up and running using Master Pages and their content pages using events to check user input. The problem that I'm encountering is how and where to declare the events so they fire just within the page that is accessed and its master page.
I've used events before but not with master pages, ie: all content pages are aspx pages. Is it necessary to create seperate classes to handle the interactivity with the events, and if so how do I interconnect them with the content pages?
The data I've come across on Google is very generic so far and handles only one master page with one content page. I only have two master pages, but it is running me through the ringer trying to figure this out.
I know that this jumbled question probably sounds like the ravings of a simpleton, but if y'all could give me a push in the right direction I would really appreciate it.
Thanks in advance.
An American football fan -
Go Seahawks!I can't believe that the 49ers beat the Hawks twice
Lil Turtle
|
|
|
|
|
To access master page controls from the content page do something like this.
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
this.Init += new EventHandler(Page_Init);<br />
}<br />
<br />
protected void Page_Init(object sender, EventArgs e)<br />
{<br />
DropDownList ddl = (DropDownList)this.Master.FindControl("ddl");<br />
ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);<br />
}<br />
protected void ddl_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
}<br />
|
|
|
|
|
Does this mean that I declare the event delegate on the master page?
An American football fan -
Go Seahawks!
Lil Turtle
|
|
|
|
|
No, thats not necessary. You just add the event in the content page.
|
|
|
|
|
Before my next question let me first thank you for all the help you've given me thus far, I do appreciate it.
When I've used events before I had to add classes that handled the event information ie: Custom data Classes, EventArgs, and Custom Handlers. Is this still necessary with the above declaration?
<edit>
I can provide code samples if it'd help.
An American football fan -
Go Seahawks!
Lil Turtle
|
|
|
|
|
You are attaching the delegate to the event with the += operator. Does that answer your question?
|
|
|
|
|
Yes it does thank you.
An American football fan -
Go Seahawks!
Lil Turtle
|
|
|
|
|
|
Hello,
I am using ASP.NET 2.0. I am trying to add textBox programmatically.
I have following method.... It is not working. What do I need to add.
public partial class Default: System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TextBox textBox = new TextBox();
textBox.Text = "Joe";
Panel panel = new Panel();
panel.Visible = true;
panel.Controls.Add(textBox);
}
}
Thank you,
Sanjeev
|
|
|
|
|
I refer you to the answer I gave some moments ago.
|
|
|
|
|
Hello Colin Angus Mackay,
Thanks for your reply. But it does not seem to work.
I put.
Page.Controls.Add(panel) to the above code. It does not work.
Can you send me working code.
I would really appreciate that.
|
|
|
|
|
Hello,
I am using ASP.NET 2.0. I am trying to add textBox programmatically.
I have following method.... It is not working. What do I need to add.
public partial class Default: System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TextBox textBox = new TextBox();
textBox.Text = "Joe";
Panel panel = new Panel();
panel.Visible = true;
panel.Controls.Add(textBox);
}
}
Thank you,
Sanjeev
|
|
|
|
|
I refer you to the answer I gave some moments ago.
|
|
|
|
|
Hello,
I am using ASP.NET 2.0. I am trying to add textBox programmatically.
I am following method.... It is not working. What do I need to add.
protected void Page_Load(object sender, EventArgs e)
{
TextBox textBox = new TextBox();
textBox.Text = "Joe";
Panel panel = new Panel();
panel.Visible = true;
panel.Controls.Add(label);
}
Thank you,
|
|
|
|
|
You have to add it to the Controls collection on the page.
|
|
|
|
|
Hello,
Thank you for your reply. I know it's simple. But it is not working when I add.
Page.Controls.Add(panel)
to the above page.
Please, send me a working one.
Thank you
|
|
|
|
|
You originally said "I am using ASP.NET 2.0. I am trying to add textBox programmatically."
So, why did you add the panel? You should add the text box.
|
|
|
|
|
Hi, I am creating a forum type. This forum consists of many sub forums in it for example: Computers, Gadgets, Music etc.... Users will login to use this forum for their own use of trading objects and bidding on object. The problems I am facing right now that I don't know are these:
1. I know how to make a datagrid with pages (After 10 post it creates another page) .. but I don't know how to access the second page of that datagrid. Can anyone help me in this pls?
2. How to upload pictures using asp.net in Ms Access database not sql.
3. How to make links from a datagrid (each row has a link) to a specific page. How can I make this happen because i dont know how to grab a specific link that the user chose.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
1. look here, when the pagination is on, it comes in number format, like 1,2,3,... or in Previous/Next format. consider the previous next format. when you are in page 5, and click next, the next page index is 6. so e.NewPageIndex = 6.
2. I will prefer to keep the images in a folder in the webserver, and keep the path of the images in database. This is done the way I have told in my previous mail.
3. Lets say your object id is objid in the database and you are binding the datagrid with a datatable which get filled from the database table of objects. Now the column will be something like this
<br><asp:TemplateColumn HeaderText="Object ID" Visible="False"><br><br> <ItemTemplate><br><br> <a id="lnkID" runat="server" href='Newpage.aspx?id=<%# DataBinder.Eval (Container.DataItem, "ID") %>'>><%# DataBinder.Eval (Container.DataItem, "ID") %></a><br><br> </ItemTemplate><br><br></asp:TemplateColumn><br><br>
For more on datagrids, read my article How to create the id of <td> and <tr> generated by DataGrid in ASP.NET and use it by client-side JavaScript.
Hope this will do.
Pradipta Basu
|
|
|
|
|
Sorry for this inconvenience .. but how i do know the page pls of the datagrid. because I am entering the DataGrid1_SelectedIndexChanged and I am making this as you told me ..
DataGrid1.CurrentPageIndex = e.NewPageIndex
An error is occuring here. red line enderneath this line. why is this? Thanks alot.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hi .. sorry but I solved the problem of question one.. Thanks alot. I was making a mistake because I want to code in the PageIndexChanged. Thanks alot. Now a problem is occuring because every time I click on the next button .. it refreshes the page and do nothing else .. it stays on the same page (it stays on number 1), then when i press it the second time it goes in number 2. Do you know whats the problem pls?
For the images .. they are 100% working thanks to you.
Now for the Links within the datagrid I didn't put the code right now. I will try it out later.
Thanks alot
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|