|
|
Thanks Mark Nischalke,
I still have the same problem(with the previous link)and even using visual studio 2008 menu web site / asp.net configuration...Username / password incorrect. Please try again.
i dont know if i have a problem in visual studio or what?
thanks (sorry i dont speak english well)
|
|
|
|
|
|
Are you seriously asking to modify the client's screen resolution from ASP.NET? No, you can't do this.
Explore your layout options. Look at relative CSS formatting (width: 80%; vs. width: 800px). At worst, discover the client's resolution and adjust.
From http://particletree.com/features/dynamic-resolution-dependent-layouts/[^]
In Javascript...
function getBrowserWidth(){
if (window.innerWidth){
return window.innerWidth;}
else if (document.documentElement && document.documentElement.clientWidth != 0){
return document.documentElement.clientWidth; }
else if (document.body){return document.body.clientWidth;}
return 0;
}
Also find following links useful.
http://devcity.net/Articles/64/1/screenresolution.aspx[^]
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
|
When you are trying to access the value of textbox??
After submitting the page, on which you have changed the value of textbox....
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi coders,
Currently I have encountered a very strange issue in my code. The summary is as follows:
Page1.aspx
<form id="frm" name="frm" action="Default.aspx" method="post">
.
.
.
.
</form>
<script language="javascript">
window.document.frm.submit();
</script>
Default.aspx
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
</form>
Default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
TextBox1.Text = "Posted Back";
else
TextBox1.Text = "Normal senario";
}
While going to Default.aspx using upper method, TextBox1.Text is comming "Posted Back" . That means IsPostBack property is set to TRUE even when going to the Default.aspx for the first time.
Can anyone please guide me why this happen?? and what should I do to get rid of this issue??
Thank You,
Anand Desai
modified on Monday, July 12, 2010 7:43 AM
|
|
|
|
|
I think the following line is re-submitting the page.
<script language="javascript">
window.document.frm.submit();
</script>
So, when it is loading the page at first time it is detecting page postback.
You can put submitting form inside condition or function and call the function whenever
you want to submit the form.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Jinal Desai - LIVE wrote: I think the following line is re-submitting the page.
No no..... You misunderstood. the HTML code I posted was of another page (say Page1.aspx ). And from that I am moving to Default.aspx using Form.Submit()
both page are diffrent, so while going to Default.aspx , I am jumping to it first time ever and so it should give IsPostBack = "False"
|
|
|
|
|
No I think you misunderstand. The html you have shown has the form action as default.aspx and the Javascript is submitting the form which will cause a postback.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: The html you have shown
The HTML I have shown is from Page1.aspx not Default.aspx ....
Both are diffrent .aspx Pages.
From Page1.aspx , I am moving to Default.aspx . Still it will give IsPostBack = "True" at 2nd Page???
|
|
|
|
|
Are you sure? the way I see it, the javascript on his HTML page is submitting the form on that page which, by it's "action" is calling his default.aspx page - and that will not call the postback.
I suspect his problem is that he hasn't properly defined IsPostBack - doesn't he need "Page.IsPostBack" in his If statement? (or Me.IsPostBack or something - sorry, not really conversant with C#)
|
|
|
|
|
See my modified question. This will elaborate my issue better I suppose.
|
|
|
|
|
NeverHeardOfMe wrote: not really conversant with C#
You don't have to be conversant in C#, or VB.NET, IsPostBack is a property of the Page object so you don't specifically need Page.IsPostBack
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
oops, yes - gosh that was dumb of me.
(Hey, it's Monday...)
|
|
|
|
|
See my modified question. This will elaborate my issue better I suppose.
|
|
|
|
|
You don't seem to understand. When navigating to form1.aspx in your browser the page will load, then the javascript will execute causing the form to be submitted. The form action is set to default.aspx so it will receive the postback.
If you want to display default.aspx immediately, then go there. Default.aspx is well, default, IIS should be configured out of the box to go to default.aspx when no other page has been specified in the request.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You know, I hate to be stupid, but... notwiothstanding your perfectly correct point regarding my earlier post, there is someething else going on here. The OP should *not* be getting the PostBack event raised, acording to what he is doing in his post.
His first page posts to the second, but the second page is still being loaded for the first time and is not a post back event.
Just to prove it, I even recreated his pages and (as expected) I did not get the post back... and I can not see why he is....
|
|
|
|
|
Mostly likely we are not being told the complete story by the OP
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You have told the form in page1 that it should always post back to Default.aspx, so when you call the submit function the page posts back to Default. If you want to navigate to Default on post back, get rid of the action="Default.aspx" or change it to page1.aspx, and put a
Response.Redirict("Default.aspx"); in the page load or some other event handler.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
The documentation on IsPostBack is not very good.
Gets a value that indicates whether the page is being rendered for the first time or is being loaded in response to a postback.
That definition assumes that the only way you are going to get to a page for the first time is through an HTTP GET. The reason being that in ASP.Net they expect pages to post back only to themselves not to other pages.
So the problem you are running into is that the page is both being rendered in response to a postback (from a different page) AND it is the first visit to the page.
|
|
|
|
|
Hi all,
I have few doubts running though my mind which I want to clear. Here is my scenario
let's say I want to create a website for library management.
I need to have registration page where I will allow users to register and login.
My doubt is : After login how do I restrict users from accessing only the authorized page ? also I need to make sure that they should not access pages by entering the url directly without authentication ? i don't want to use the login controls provided in asp.net by default.
Thanks
|
|
|
|
|
Forms Authentication
I think this should cover what you want, it essentially provides an authentication model for you that doesn't have to use .NET login controls, you can use the API to come up with one yourself.
|
|
|
|
|
thanks.. I will look into it.. any other techniques ?
|
|
|
|
|
Dear friends,
I have a linkbutton in gridview. When I click on that linkbutton, I need to get some data based on the row which I clicked and this data to be sent to a javascript function. Please help me how to achieve this. It's very urgent.
Regards,
Cheguri.
|
|
|
|