|
assuming you dont want to pass any kind of session info between the pages...you can use Response.Redirect(address);
since they are different projects i assume they will run under different domains, so session info wont transfer..and since they're different pages viewstate wont either. if you have to pass information between them, the only way i can think of is to either put the information into the query string and go to a "hide" page which puts it back in the session and redirects to the page you want(small security hole there..well not really small) or the better way is to put the info into a temp table in the database with a random pointless temp id that is generated each time, an dpassed to the new page in a query string, which th enew page uses to lookup the info and then delete it from the database, once its been read into memory..thereby preventing anyone from breaking in because the table will have random id's and will never have much data in it...once you're able to see the ID its already been deleted. if you want to hide the query string, you can either use a frameset when you first go to the page, or use a "hide" site to quickly move it to the session then go to the new page.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hi
Thanks for ur concern but right now i dont want to pass anything in between ....................u said response.redirect(address)
but the question is if the applications installed on the server which has the ip say for example :- 123.12.3.23 and application folder name dialgmr in wwwroot of IIS then it will be
Response.Redirect("123.12.3.23/dialgmr/default.aspx);
Is that ur mean and this will not run on asp.net server localhost
Plz Give some example if possible
Thanks a lot !
Thanks & Regards
Manish Singhal
Software Engineer
Maxworth systems(Delhi)
|
|
|
|
|
ok say i have 2 web apps... a main app and a app that lets me process credit card info..you get to the main app by going to www.jimbob.com(i dontknow if thats a real address or not), and the payment app is in a subdomain payment.jimbob.com so that i can use it from other apps when i build them. make sense so far? good, now i have a button somewhere in the mainapp that takes you to the payment piece to buy something, so in the button click i'd insert data to the db(i do need to pass things between sites) and do a Response.Redirect("http://payment.jimbob.com/payment.aspx?tempId=35hgs"); now that obvisouly wont work in my dev environment because the dns records for jimbob and payment.jimbob poitn to my production webserver. so i put an entry into the <appsettings> section of my web.config file for the main app project that looks like, <add key="paymentPath" value="http://payment.jimbob.com/payment.aspx"> so with one change i make the apps work in dev or prod(i also have one for the connection string to th db so i can switch between dev and productio ndatabases easily. with the web.config entry my button code changes to
Response.redirect(ConfigurationSettings.AppSettings["paymentPath"] + "?tempId=35hgs");
i have used this method but have not tried the code snippets here, i may and probably do have typo's,sorry. if you're in dev and your dev machine is hosting everything, you can use http://localhost/whatever but you do have to have the http part if your leaving th ecurrent project/domain(changed from www.blah to payment.blah counts as changed domains espically if you are using ssl to secure things(i recommend that) and session info wont transfer..it also wont transfer between secure and non secure as the session is encrypted comeing out of secure, and its expceted to be encryped going into it..i may be wrong with the newwer versions out now, but i remmebber having that problem a couple years ago. If however you want to simply change directories or pages in the same projet you can use relative paths ../newdir/newpage.aspx or if everything is in the same dir you can use "newpage.aspx"
hope this is more helpful. if you want the exact code or more code than i've given you i recomend asking someone else, or reading the msdn pages about Response.Redirect or some of the articles here i know deal with it. for something more complicated i may post full or more code, but i hate posting full code for people because the vast majority just copy it and never learn how it works and its mine/our fault when it breaks.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thanks. now i dont need to have two diff projects so this issue will never arise . thanks a lot
Thanks & Regards
Manish Singhal
Software Engineer
Maxworth systems(Delhi)
|
|
|
|
|
I have a trivial webservice set up that takes a single parameter and returns a number of items according to the value of the parameter:
[WebMethod( Description="Returns the top 'count' latest articles.")]
public XmlDataDocument GetLatestArticles( int count )
{
if (count < 1)
count = 1;
if (count > 100)
count = 100;
return ArticleCache.GetLatest( count );
} I have some simple parameter checking, such that the method will always return at least one article and at most, 100 articles.
However, if the client does not provide the count parameter at all, a System.ArgumentException is thrown before the webmethod is called and an ugly error is returned to the client. I would like to be able to catch this exception and supply a 'default' value to the inner method call, so that the client continues to function.
I tried making the count parameter nullable, but then the default WsdlHelpGenerator.aspx doesn't display it, because "The test form is only available for methods with primitive types as parameters." This makes it rather difficult to test - especially as the services are for consumption by a third party developer.
Is there any (elegant and easy) way of catching the exception and handling it gracefully?
Thanks.
|
|
|
|
|
depending on how you have things set up..i wrote an xml file and from there had a wsdl and server stubs generated, but in the XML i'm pretty sure that you can make the parameter optional, then look for it in the server and give it a default value if it s not there. or you might be able to set a default value in the XML...since you typically need a wsdl and the xml file(maybe) to generate a client app, it should work for everyone. i believe setting the minoccurs attribute to 0 in the xml file makes it optional, but i have not tried it.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi there,
I've craeted a new WebControl in my controls subfolder of my project named myWebControl. VS2005 now created a public partial class controls_myWebControl which derives from System.Web.UI.UserControl. My myWebControl has some Properties, The trouble I have is to load this control in Webpages (project folder) calling
<code>controls_myWebControl myCtrl = (controls_myWebControl)Page.LoadControl(path to myWebControl);</code>
I can only create an instance of WebControl but now I can't use my properties. Any advice? Thanx in advance!!!
|
|
|
|
|
Hi,
Just check whether you have set accessors also defined for the properties in your user control.
And also just check whether the access modifier of the field is private and the property is public.
As i see there is no problem the way you have done it..
Hope it helps
Thx,
Gayani
|
|
|
|
|
Our shop is just starting to write ASP.Net applications. We're trying to think ahead and write our applications with easy maintenance in the design.
We'd like to put some of our connection strings that will be used by multiple web applications in one area. We were thinking about the machine.config file but we're not sure if this is as secure at the web.config is supposed to be or not?
Any suggestions?
Lost in the vast sea of .NET
|
|
|
|
|
|
I want to request a page which is located in IIS server of one PC in network from other PC of network.
How I can deploy my webproject at IIS and access that web page from other PC of network.
Any one pls help me....
|
|
|
|
|
http:// <computername>/<the page="" you="" want="" to="" request="">where computer name is the name that the page is located at
|
|
|
|
|
thanks for reply.
But suppose my ip address is 198.168.1.1 and i have deploy my website on the IIS server of this computer. So i can use
http://localhost/Myproject/login.aspx
but other PC on the network which has ip address 198.168.1.2, can use which path ?
http://198.168.1.1/Myproject/login.aspx
this path not work so tell me how i can use login.aspx file which is on 198.168.1.1 PC
|
|
|
|
|
Hi all.
I need to check a web page and compare his data with the data in a data base, access data on textbox and click in same buttons programmatycally.
Somebody can hept with a start point? Somebody nows if with silverligth I can do that. Maybe scraping?
Thanks.
|
|
|
|
|
How do I make input in certain fields mandatory? I've gotten nothing but unrelated junk when I've tried googling.
====================================
RequiredFieldValidator
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
modified on Thursday, July 31, 2008 10:19 AM
|
|
|
|
|
|
Hi there,
I'm currently trying to fix a bug in a site that uses a gridview to load info from a database via a few dataviews into several tabs in a tab control.
Part of this information is the latitude and longitude which is used to display a map on virtual earth. I am having a problem in that the javascript GetMap() is called by adding an onload command to a body I have nested in the fourth tab.
This means that the javascript is only getting called once as I'm using an update panel to remove full postback.
I'm calling the javascript from the dataview databinding sub on the server side to prevent the map from being loaded too early without the necessarry information.
How can I call the javascript eveytime the index is changed on my gridview??
You can see the problem on http://www.ozfarmguide.com/Farms.aspx[^]
Many Thanks
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
JimBob SquarePants wrote: I'm calling the javascript from the dataview databinding sub on the server side
No you are not. Server side code cannot call/execute client side code.
JimBob SquarePants wrote: How can I call the javascript eveytime the index is changed on my gridview??
As I stated above you can't. What one can do is take advantage of whatever client side mechanism they are using, like body.onload event, to execute javascript code. In your case since you are using an Ajax call (update panel) then you need to use whatever mechanism it supplies to execute client code upon return of the request to the browser.
led mike
|
|
|
|
|
Yeah sorry, call was probably not the best choice of words.
I tried adding OnLoad="GetMap()" to the markup on my UpdatePanel but I returned this compilation error: 'GetMap' is not a member of 'ASP.farms_aspx' The client side attributes are not available in the code behind unlike the body.
Javascript is a great unknown to me. I had real trouble getting the map to show properly in the first place.
What's your advice?
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
JimBob SquarePants wrote: Javascript is a great unknown to me.
JimBob SquarePants wrote: What's your advice?
My general advice is not to work with technology that is unknown to you without first learning it. As to your current problem, I have never worked with the update panel but I imagine there must be a client side mechanism to leverage upon return to the browser. I would also imagine there is some small amount of example code in the MSDN documentation for the update panel control. I would certainly start by looking there. If that is not enough I would goolge for something like: ASP.NET UpdatePanel tutorial
led mike
|
|
|
|
|
Thanks for the pointer.
Sometimes the problem with Google is knowing what to look for.
It turns out I had to put this command into my GetMap() Function:
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(GetMap);
I understand the principle but not the science itself. Looks like I have a lot of swotting up to do.
Thanks Again
James
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
I've ran into an access limit while trying to update a table with an insane number of fields. While access supports 255 fields/table the maximum number for an update query is only 127. tblWtf is at ~170. Currently the gridview is wired directly to an AccessDataSource with a single massive query: UPDATE tblWTF SET WTF1 = ?, WTF2 = ? ... WTF170 = ? WHERE (WTFID = ?) . The guilty project management has proven resistant to cluebats so I need a planB to make their 'design' 'work'.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
how to make a Task Scheduler in asp.net
|
|
|
|
|
1. Design
2. Code
3. Test
Please be more specific.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Task Scheduler a module which will run after perticaular interval of time to do any perticular task. In my case send email to user 3 days before his due date
thanks.
i m reading few articles on net but finding bit difficult thats y asking and plz 1 more thing is Global class is .asax file ??
thanks very much
|
|
|
|