Click here to Skip to main content
15,907,392 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Calling a web form as a class Pin
abdelhameed8122-Mar-08 3:27
abdelhameed8122-Mar-08 3:27 
GeneralRe: Calling a web form as a class Pin
pmarfleet22-Mar-08 3:51
pmarfleet22-Mar-08 3:51 
GeneralRe: Calling a web form as a class Pin
abdelhameed8122-Mar-08 4:01
abdelhameed8122-Mar-08 4:01 
GeneralRe: Calling a web form as a class Pin
Colin Angus Mackay22-Mar-08 3:23
Colin Angus Mackay22-Mar-08 3:23 
GeneralRe: Calling a web form as a class Pin
abdelhameed8122-Mar-08 3:30
abdelhameed8122-Mar-08 3:30 
QuestionAdding user control at runtime Pin
indian14322-Mar-08 1:59
indian14322-Mar-08 1:59 
GeneralRe: Adding user control at runtime Pin
Colin Angus Mackay22-Mar-08 3:21
Colin Angus Mackay22-Mar-08 3:21 
Generalthat assembly does not allow partially filled callers Pin
Nishad8522-Mar-08 0:40
Nishad8522-Mar-08 0:40 
Hi,
i have uploaded my site to web server goddady.com
i have a button to download dyanmically generated excel file.This button is ajax enabled.....When i am click on this button it will popup a message like

"That assembly does not allow partially trusted callers"
This is my web.config file

Code: ( xml )
1. <?xml version="1.0"?>
2.
3. <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
4.
5. <configSections>
6. <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectio nGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
7. <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
8. <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHa ndlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
9. <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSecti onGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
10. <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializatio nSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
11. <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSe ction, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
12. <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationSe rviceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
13. </sectionGroup>
14. </sectionGroup>
15. </sectionGroup>
16. </configSections>
17.
18. <appSettings>
19.
20. </appSettings>
21. <connectionStrings/>
22. <system.web>
23.
24. <compilation debug="false">
25. <assemblies>
26. <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
27. <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
28. <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
29. <add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
30. <add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
31. <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
32. <add assembly="Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>
33. <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
34. </assemblies>
35. <buildProviders>
36. <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
37. </buildProviders>
38. </compilation>
39.
40. <authentication mode="Windows"/>
41.
42. <pages styleSheetTheme="Smoke">
43. <controls>
44. <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
45. </controls>
46. </pages>
47.
48. <customErrors mode="Off" defaultRedirect="Error.aspx">
49. </customErrors>
50.
51. <httpHandlers>
52. <remove verb="*" path="*.asmx"/>
53. <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
54. <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
55. <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
56. </httpHandlers>
57. <httpModules>
58. <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
59. </httpModules>
60. <identity impersonate="true" />
61.
62. </system.web>
63.
64. <system.web.extensions>
65. <scripting>
66. <webServices>
67.
68. </webServices>
69.
70. </scripting>
71. </system.web.extensions>
72. <system.webServer>
73. <validation validateIntegratedModeConfiguration="false"/>
74. <modules>
75. <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
76. </modules>
77. <handlers>
78. <remove name="WebServiceHandlerFactory-Integrated"/>
79. <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
80. <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
81. <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
82. </handlers>
83. </system.webServer>
84.
85. </configuration>

This code below is for generating Excel




//launch an excel instance
Excel.Application excel = new Excel.ApplicationClass();

//set the visibility to true
excel.Visible = false;

//Add a workbook object
Excel.Workbook workbook = excel.Workbooks.Add(Server.MapPath("~\\General\\Invoice\\Invoice.xlt"));

//Create a worksheet object
Excel.Sheets sheets = workbook.Worksheets;

//from the collection of worksheet select one worksheet
Excel.Worksheet mySheet = (Excel.Worksheet)sheets.get_Item("Invoice");

//select the cell in the worksheet
Excel.Range name = (Excel.Range)mySheet.get_Range("B8", "B8");
Excel.Range school = (Excel.Range)mySheet.get_Range("B9", "B9");
Excel.Range street = (Excel.Range)mySheet.get_Range("B10", "B10");
Excel.Range city = (Excel.Range)mySheet.get_Range("B11", "B11");
Excel.Range tel = (Excel.Range)mySheet.get_Range("B12", "B12");
Excel.Range date = (Excel.Range)mySheet.get_Range("F3", "F3");
Excel.Range invoiceNo = (Excel.Range)mySheet.get_Range("F4", "F4");
Excel.Range dueDate = (Excel.Range)mySheet.get_Range("F15", "F15");

//assign text value to string
string contact = lblName.Text;
string schoolName = lblSchName.Text;
string address = lblStreet.Text;
string state = lblCity.Text;
string telephone = lblTel.Text;
string currentDate = lblDate.Text;
string invoiceNumber = lblInvoiceNo.Text;
string dateDue = lblDueDate.Text;

//Add a text in the cell
name.Value2 = contact;
school.Value2 = schoolName;
street.Value2 = address;
city.Value2 = state;
tel.Value2 = telephone;
date.Value2 = currentDate;
invoiceNo.Value2 = invoiceNumber;
dueDate.Value2 = dateDue;


string url = Server.MapPath("~\\General\\DownloadInvoice\\Invoice.xls");


try {
FileInfo TheFile = new FileInfo(url);
if (TheFile.Exists)
{
File.Delete(url);
workbook.SaveAs(url, Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);
workbook.Close(false, null, null);
}
else
{
workbook.SaveAs(url, Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);
workbook.Close(false, null, null);
}
}

catch (FileNotFoundException ex) { }

Please help me on this issue?
GeneralCrytal reports vt asp.net Pin
slSoftware21-Mar-08 23:54
slSoftware21-Mar-08 23:54 
QuestionASP.NET Divs Pin
jonhbt21-Mar-08 22:50
jonhbt21-Mar-08 22:50 
GeneralRe: ASP.NET Divs Pin
N a v a n e e t h21-Mar-08 23:16
N a v a n e e t h21-Mar-08 23:16 
GeneralRe: ASP.NET Divs Pin
jonhbt25-Mar-08 21:36
jonhbt25-Mar-08 21:36 
GeneralSend Mail & Error Pin
mehrdadc4821-Mar-08 22:38
mehrdadc4821-Mar-08 22:38 
GeneralRe: Send Mail & Error Pin
N a v a n e e t h21-Mar-08 22:54
N a v a n e e t h21-Mar-08 22:54 
GeneralSystem.NotSupportedException: Collection is read-only. Pin
saltcode21-Mar-08 21:54
professionalsaltcode21-Mar-08 21:54 
GeneralRe: System.NotSupportedException: Collection is read-only. Pin
N a v a n e e t h21-Mar-08 21:59
N a v a n e e t h21-Mar-08 21:59 
GeneralRe: System.NotSupportedException: Collection is read-only. Pin
saltcode21-Mar-08 22:53
professionalsaltcode21-Mar-08 22:53 
GeneralRe: System.NotSupportedException: Collection is read-only. Pin
N a v a n e e t h21-Mar-08 23:11
N a v a n e e t h21-Mar-08 23:11 
QuestionHow to disable prompts for ActiveX controls Pin
Anuradha61221-Mar-08 19:56
Anuradha61221-Mar-08 19:56 
AnswerRe: How to disable prompts for ActiveX controls Pin
Christian Graus21-Mar-08 19:57
protectorChristian Graus21-Mar-08 19:57 
GeneralEditable combobox in ASP.Net Pin
new2pgrmg21-Mar-08 19:51
new2pgrmg21-Mar-08 19:51 
GeneralRe: Editable combobox in ASP.Net Pin
Christian Graus21-Mar-08 19:57
protectorChristian Graus21-Mar-08 19:57 
Generalaccess server controls using javascript in web user controls Pin
indian14321-Mar-08 18:38
indian14321-Mar-08 18:38 
GeneralRe: access server controls using javascript in web user controls Pin
Christian Graus21-Mar-08 19:32
protectorChristian Graus21-Mar-08 19:32 
GeneralRe: access server controls using javascript in web user controls Pin
indian14321-Mar-08 19:51
indian14321-Mar-08 19:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.