Creating A Zip For Multiple Files?
Mar 23, 2011I want to create a zip files for multiple file
Ex: Folder One-----------> file1, file2, file3
want to zip 3 files into folder.zip
I want to create a zip files for multiple file
Ex: Folder One-----------> file1, file2, file3
want to zip 3 files into folder.zip
I have to define a web method which will fetch XML documents from another web service based on the list of projects from the database. Now I need to send these XML documents in different SOAP envelopes. XML documents can be more than one.
View 1 RepliesI have an application that uses resource files to display items in multiple languages. My app uses quote a lot of javascript and the alerts need to display in the local language. To do this, I have created an http handler which will read the keys and values of the culture-specific resource file and write them to a JSON array which is then embedded in the page in a script tag, the messages can then be accesses using, for exmaple:
Message.Error (en-GB = "Error", fr-FR = "Erreur")
The messages http handler works great in development, however when I run the application on a test server, I get the error: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resources.Alerts.resources" was correctly embedded or linked into assembly "App_GlobalResources.b0n9j90e" at compile time, or that all the satellite assemblies required are loadable and fully signed. The code that I use to acccess the resource file is:
ResourceManager manager = Resources.Alerts.ResourceManager;
ResourceSet resourceSet= Resources.Alerts.ResourceManager.GetResourceSet(Thread.CurrentThread.CurrentCulture, true, true);
Where Resources.Alerts is the type that contains my multi-lingual definitions. The build action for the Alerts.resx file is set to "Embedded Resource". Any ideas why this works locally but not on my test server, am I missing something?
Is there a way of filtering large CSS files for the only required selectors on a page, and creating css files that contain just these selectors?
Case: I have a very large CSS file that I want to filter on a per page basis, so that the file size is cut down and can be cached by mobile devices. I was thinking along the lines of something like a server side dust me selectors tool.The particular project I am working on is using ASP.NET MVC.
I'm very new to ASP.net, so I'm just figuring this out.First off, I have multiple separate projects that will be hosted on the same server.Second, they must be able to share certain settings (like connection string, configuration options, etc).Third, those shared settings must be configurable for different deployments (test, prod, etc).
View 1 RepliesI am trying dynamically to create an .ics file when ever a user clicks on a attend button in an asp.net application . But it is throwing an runtime error. if we dont have any controllers except other than a single button control , we were able to generate the .ics file, but a full fledged aspx page which in turn is associated with an master page . we are getting errors.can some one let us know if there is an alternative solution for these kind of issues.
View 4 RepliesI am using the below code to create file after reading the body
from the database. body contains the content of the document in MIME format.
string dataDir = "D:\Temp_Attachment\";
string strXml = System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(body));
Stream wordFile =
new
FileStream(Path.Combine(dataDir, filename),
FileMode.Create);
StreamWriter xmlWriter =
new
StreamWriter(wordFile,
Encoding.Default);
xmlWriter.Write(strXml);
xmlWriter.Close();
wordFile.Close();
The problem i'm facing is that above code works for text files.
When I'm creating image files or pdf files, those files give an error on opening.
I am creating an site where a user uploads an excel file to check if any of the records exist in a database. Then they are returned an excel file with only the records that are NOT in the database.
I was thinking I should do it this way1. User uploads their excel file. The app opens excel file and loads records into a dataset (so far this is working with the code below)2. Using datarow and another function to check if each excel record exists in the database3 If the record does NOT exist, and it is the first record tested, create an excel file called records.xlsx and write the record into the file
4. Check the next record and if it does NOT exist in the database, then check if records.xlsx already exists then open it and write it into it.
[Code]....
Hopefully its clear, sorry if its not, I'm a bit of a novice at this. Is this a good way to do it? Does anyone know of any tutorials that might outline how to open an existing file and write to it?
I was creating an application which list all the files and folder in any drive but when i m running this app i am getting a strange exception called
Code:
System.Security.SecurityException: Exception from HRESULT: 0x800A0046 (CTL_E_PERMISSIONDENIED)
I search the web and found that i need to include this in web.config file so i did
Code:
<trust level="Full"/>
I've inherited a SQL Server 2005 table where there are several colums of the image datatype. I'd like to extract all of those images and save them as files to a folder. How can I do this using VB.NET?
Brian
The way we have to update our site now is to create a copy of the website project locally. Make changes. Then take the dll and any other new files and copy them to the project on the server. Sometimes they want us to work on something they need uploaded right away and other times work on something that needs to be uploaded in the future. So I have to do silly things to give them what they want now and exclude what I am working on for later. What is the best way to resolve this? I just wanna have to upload a piece of the project and certainly not the a whole new dll everytime.
View 1 RepliesI have a question concerning website structure. I have a website which will be an intranet site. On this site I will have a main page that has links to different apps that will reside in this site. I want to separate the apps in their own folders.My question is do I just create a folder for each one or do I create a new webpage within the main webpage for each one? The reason I am asking is I use three layer model and my object data classes and db classes need to reside in App_Code folder. Do I put all these from every app in the one folder(on the main page) or if I create a site within a site can each have it's own App_Code folder. Also if I create the site within a site will I be able to redirect to different pages just by relative URLS(../cashmanagement) and everything work OK.I am pretty new to ASP and this is my first site with mutiple programs.
View 3 RepliesActually I'm not a professional in ASP.NET. I'm going a project that needs to support two languages (Russian and English).I've already completed the main parts and the site is now 95% functional.However, now I need to enable language selection on the site.
I'm going to do it with DropDownList, where a user chooses one language from DropDownList, the content must change to particular language.
All texts are displayed using server controls like Labels and Literals. Links are in Hyperlink or LinkButton.
I did some research to handle with my condition, but no-one suits on my condition, because I've almost completed the application. How to generate Global Recourse files for controls on the page?
I have a gridview which can be filtered from one or more values in a querystring. That all works great: e.g. "?subject=Maths&authorName=Bond_James&type=Magazine"
The values passed to the query string come from 3 drop down lists: Subject, Author, Type. What I'd like is when the user presses "Filter" it will take the selected values from the drop down lists and pass them to the querystring - it could be 1 value, 2, or all 3 (like above).
The drop down lists have an item called "All Subjects" / "All Author" / "All Type" each with a value of -1. The idea being that if the user leaves these items selected then the Filter button just ignores them.
Here is my code so far:
[Code]....
Also, one more thing. How do I get the drop down lists to have the filters selected when the page re loads?
EDIT: I changed the default values of the drop down lists to "" - this leaves the URL looking messy though ?author=&subject=&type= This works, is it the best way?
i'm trying to design a search page. i want to creating few radio buttons where each click on a radio button will show a div contains the related search div's. and from there to do the query to the database(not related to the post) how can i do that? tried to search for it , and didn't get good answer. i want that the change of the page will be in server side and not the client side. I have been working with ajax control kit so far
View 2 RepliesI want to create several instances of a webcontrol on my web page each time the user clicks an 'add' button.
HTML
[Code]....
c#
[Code]....
I have a IIS server in my company which runs our intranet application, We assigned one static IP to it in order to access through internet. when we to mapped our application address eg : http://ip/applicationname to one host name, after loading when i try to access any page it was again showing ip address instead of my host name. When I check with my ISP, he told me that to resolve this either you have to put your application folder in root directory(directly in Inetput/wwwroot) or you have to create sub domain, when I put all my fies to root directory it is working well, but , I found that for all other application which i put the folders inside wwroot are taking the config file from root, how can i resolve it... or just explain me how to configure subdomain in my server to solve this issue....
View 1 RepliesI have a userControl with with two DDLs and two RBLs, and public properties to get/set the values. If I register the UC on a page it works fine....I can set/retrieve the values without a problem.
I need to create multiple UCs based on records I'm pulling from a dB, so I'm trying to instead create the UCs programmatically. I'm testing this by adding a reference to the control ("symptomBasic"), creating a placeholder ("ph1") on a page and then trying to populate it with the UCs in PageInit. (the parent page uses a master page)
Partial Class testUC
Inherits System.Web.UI.Page
Private myUC As ASP.symptomBasic
Protected Sub Page_init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Dim i As Integer
For i = 1 To 3
myUC = CType(LoadControl("~/controls/symptom.ascx"), ASP.symptomBasic)
ph1.Controls.Add(myUC)
Next
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
End Class
When I load the page, I get three UCs in a row, and they work properly on postback...i.e. all the values are preserved. Question is, how do I then find the controls on postback when I want to populate them with data or read the values back?
Let's say I know I returned 3 rows from the dB and created 3 UCs during pageInit...how do I then access those controls to read back the values provided by the user? I see that each control has an ID like: "ctl00_ContentPlaceHolder1_ctl01_cName", where each set of controls is "ctl00", "ctl01", etc.
I am creating and configuring multiple TreeView controls programmatically:
foreach (DataRow dr in ds.Tables[0].Rows) {
TreeView TV = new TreeView();
TreeNode newNode = new TreeNode();
[code]...
I have a form which I use to create an issue. WHen you post the form, the form elements are that of a custom DTO. The DTO is then used on my POST method to create the new entity. That all works fine.
However, I want to add the functionality to add multiple issues at the same time from the same view. In effect, the user would click something like 'Report Additional Problem', and an extra set of form fields would appear (I will like use jquery for this, which I don't have an issue with). However, even with just leaving one set of form fields, the user should still be able to create just one issue. But if I habve my post method take a list or array of my DTO, it doesn't work.
Here is the post method before editing:
[Code]....
What I want to do is for this to take an array or list of NewIssueDto. I would then loop through each one in the list and create a new issue from it.
I want to create a dropdown of Vendors. I have a Vendors table in my DB, containing a VendorID and a CompanyID. The Company table contains a CompanyID and a Name.
I would like to have a dropdown with items that have the VendorID as the value and the Company Name as the text. But I don't know how to get the Name field from the related table to put in the dropdown, so I have the VendorID as the value and text. Here's what I have right now.
I'm passing in a model that contains this:
public IEnumerable<Vendor> Vendors { get; set; }
In my controller, I'm setting the value of Vendors like this:
MyDBEntities _entities = new MyDBEntities();
Vendors = _entities.Vendors;
Here is my dropdown list on the page:
<%= Html.DropDownListFor(m => m.VendorId, new SelectList(Model.Vendors, "VendorID", "VendorID"), "- Select a Vendor -")%>
I thought I could create a custom function - GetVendorsForDropdown - that would return only the data I needed, and changing my model to contain IEnumerable<Something>. But I don't know what the return type should be.
I have 2 different website/applications with 2 different asp.net membership databases in the same server. Now my client wanted to create a user in one website and add that person automatically in to the other application/website/database too. Right now my applications create users using asp.net membership and added to its respective databases. Is it possible to create a user from different application using asp.net membership?
View 6 Repliesi am managing three applications .. i hve separate pages in each of these applications for creating users and roles..
can i create a single page where in i can choose for which applications i want to create users..
i am storing the users of each of thse 3 applications in a same database and i hve separate application name for each application in membership provider
If MVC application has multiple projects (The solution may grow large in future). These projects may share controllers such as application controller accouts controller and there may also be a situation in which namespace of one project is shared by other project. What is the best way of implementing such solution. One approach may be to use areas.
View 4 RepliesI have a dataset with 3 tables that are inner joined. Thsi dataset is connected to an object datasource which is connected to a gridview. So at runtime it displays data from the database. The problem is when I click on a save button to add information to the database it throughs me an error saying Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. But if i have two tables in my dataset it works 100%. But the problem i need that 3 tables in order to pull the required information. And if i populate the gridview using code to select the information from the database and insert information it also works 100%.
View 3 Replies