You are welcome! and I'm sorry for being a bit grumpy, my day sucks today :) Btw, I think you really should try that profile provider mentioned, it is better than plain XML file read/write access and it is also integrated into you object model, in your code you can access your Profile properties directly. http://msdn.microsoft.com/en-us/library/system.web.profile.profilebase.aspx[^]
l0kke
Posts
-
Save multiple to XML -
problem in closing the windowI don't know if that's your problem, but I remember that I was struggling few years ago with something similar. The headache was caused by the fact that postback in modal window doesn't really work as expected. The workaround was to do all the popup window eventhandling on clientside with javascript, or, better solution, have a iframe in your popup window and load your aspx page into that iframe. It is possible that your problem is something different, I just wanted to mention that this can be the case :)
-
Save multiple to XMLYou didn't say what is your actual problem... I guess you are familiar with XmlDocument class, if not, then shame on you, because you haven't done your homework before asking a question here ;) XmlDocument myXmlDoc = new XmlDocument(); myXmlDoc.Load(myFilepath); ... myXmlDoc.Save(myFilePath); http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^] You can also use ProfileProvider approach: http://aspnet.4guysfromrolla.com/articles/101806-1.aspx[^]
-
this error occure in my function:not all code paths return a valueFirst, be sure you close the connection all the time, in your code, the line MyConn.Close(); is never called! And the reason for the error is, that you don't return anything when there is an exception. you need to have a return statement in your catch block, however, cleaner solution would be to have a finally block after catch, where you return a value
-
login into the another siteMy friend, answer to your question is too complex to be explained in one post here. It would be better if you start with something and ask for particular problem you are facing. The best way I guess is to start with the WebRequest class, which helps you to work with the content of the page: WebRequest myRequest = WebRequest.Create("http://www.ThePageIWantToWorkWith.com"); more here: http://msdn.microsoft.com/en-us/library/system.net.webrequest(VS.71).aspx[^]
-
login into the another siteTo be completely correct, you CAN do it in ASP.NET, but I don't see any reason why would you :)
-
creating aspx pages at runtimeWhat seems to be a new page doesn't have to be a new page at all, maybe they're just using URL rewriting. Check this article: http://msdn.microsoft.com/en-us/library/ms972974.aspx[^]
-
How to set multiple Login pagesMaybe Page.Request.UserLanguages array can help you to determine what is user's preferred language. But always keep an option for a user to change the setting and store it in a cookie.
-
How to set multiple Login pagesYou are quite welcome :)
-
How to set multiple Login pagesTry to take a look here, I guess that's what you need: http://msdn.microsoft.com/en-us/library/ms227427(VS.80).aspx[^]
-
Saving User Name And Password.I agree with Chrisitan's post below, that's how I would do it probably, but I still don't know what is your scenario, so there could be better way how to achieve what you need.
-
Saving User Name And Password.why do you need to store this on client side? there might be better solution for that. if you really need to store this in a cookie, then you have to encrypt the information at least. check eric newton's article on cookie encryption: http://www.codeproject.com/KB/web-security/HttpCookieEncryption.aspx[^]
-
downloading a large file using asp.net 2.0 with C#wild guess, isn't problem in this line: Response.AppendHeader("Content-Length", filename.Length.ToString()); where you are saying that content of the response is as long as length of the filename? Pilo
-
Problem in page RedirectYour code is filling drop down from database on PageLoad, if region name selection changes, it inserts additional data from the db (not clearing previous data from the drop down!, is it what you want?) I don't see any redirection at all! However, few tips: 1. in sqlcommand, always use Parameters instead of concatenated strings as a query, to prevent sql injection (security flaw): SqlCommand com1 = new SqlCommand("select district from DistrictInfo where StateName = @RegionName", con); com1.Parameters.Add(new SqlParameter("@RegionName", RegionName)); 2. be sure you are closing connection to database when you don't need it anymore 3. use 'using' clause when possible, to ensure your IDisposible objects are going to be disposed in all cases (no need to call dr.Close(), as it is going to be called in Dispose() method: using (dr = com1.ExecuteReader()) { while (dr.Read()) { drp_unitname.Items.Add(dr[0].ToString()); } } 4. use exception handling, try {...} catch {...} blocks, at least in event handlers
-
Database mapping of 2 different sql database using .NET codeYou are asking in wrong forum, try this one: http://www.codeproject.com/script/Forums/View.aspx?fid=1725
-
Found 1 intresting but strange problem while reading XML [modified]and what is the token on line 778, position 626?
-
format of path in window.open()You can't use physical path, unless you want to use your web application only for yourself on your local computer. (Other users probably don't have the file on the same physical path) If you have the a.htm file in the same folder as the file that contains the code above, then use just window.open('a.htm') if not, then you still can use relative path, for example window.open('SubFolder/a.htm') or window.open('../a.htm') THIS IS PREFERED WAY! or if you know what is going to be the url of the a.htm, then use it: window.open('www.myserver.com/myApp/a.htm') Note that url shouldn't be hardcoded, but should be determined in runtime (as zour application might be deplozed on more than one server, or the server name can be changed) Pilo
-
syntax errorreplace your " with \" in the javascript string, or use ' instead
-
Web Service vs. direct connection to the database.Generally, the advantage of WebService is that you can plug in multiple clients - Web interface, WinForms client etc. to the web service, and those clients don't need to have any knowledge about the database itself. Also, it is more maintainable, if anything changes on the db level, you need to change only the webservice, not every client. Another point is a security, if you are accessing the database from WinForms client, anyone can reverse engineer the client app and see connection string or username/password combination. When you keep this information on the web service, only privileged users (users with log-on access to the server) can have possible access to this information. However, if your scenario is restricted to ASP.NET application -> WebService -> DB server structure, I don't really see the point having the WebService, especially if the WebServer and the WebService are running on the same machine. I would say you should build data access layer within your web application then. Pilo
-
Error: Value of type 'Byte' cannot be converted to '1-dimensional array of Byte'My knowledge of VB is rubbish, but I would say the problem is as follows: cmd.ExecuteScalar() returns object, which is supposed to be array of bytes, but your call CByte(cmd.ExecuteScalar()) is trying to convert this object into object of type byte (not array of bytes) and that causes your error. Unfortunately, I don't know correct syntax in VB for casting object into array, I hope you do (otherwise you have to google it :)) Pilo