|
Yes, there is a reason.
This page uses a free javascript code called niceforms (http://www.emblematiq.com/lab/niceforms/), it has several bugs and needs to be recharged several times. And the problem is that it does not reload correctly if called at events such as onLoad or EndRequest in html (I do not know why). So, I created a static method in BasePage application that contains a method that performs this function across the ScriptManager.
The solution I found was this, and I'm just calling it in Page_Load when is postback.
Thank you.
|
|
|
|
|
brunoseixas wrote: The solution I found was this...
No the solution is to use code that isn't buggy and functions appropriately.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes, of course. Tell that to the dummies of the commercial area. Haaaa
|
|
|
|
|
Hi,
I am debugging through a web application that was written in C#. When the app loads it gets some values using static methods. Whenever I stop the debugging and run it again then it doesn't go into these static methods again as they are static. I want to kill this static variable instance so that I can debug through these methods again. I have stopped the web server in VS2010, but it doesn't work. I hope I am making sense?
Thanks
|
|
|
|
|
That isn't what static methods mean. Static means that they do not rely on an instance of the object. If you call the method it will be executed every time it is called. If you aren't hitting your breakpoints in the static method then something else is going wrong.
|
|
|
|
|
Thanks for the reply.
I'm actually testing a singleton that was written to retrieve global values. It's the first time I am working with singleton so I am debugging to see how it works. The first time I ran it I got the instance of the singleton object, then I stopped it. I ran it again, and it doesn't go into the property where it returns the singleton's instance. I am using VS2010.
Thanks
|
|
|
|
|
Too many pronouns. When you ran "it", is "it" an exe, a method? If "it" is a method I would not expect a singlton to run the code to create an instance more than once. That is what makes something a singleton. Your description of the situation is far too vague to really give you any concrete answers.
|
|
|
|
|
Because the content pages can have different size so I am having problems of positioning the content pages inside the Master, and the Master Elements don`t keep an strict position, Because it must be a normal problem I think that it shall have a normal solution, but I don´t know it, so could you please tell me if is there any rule or way of keeping the Master elements unchanged independently of which content page is located in.
Best Regards
|
|
|
|
|
1. Use Flow layout
2. Use html tables in your master page to design your UI. This would keep your master controls intact and a specified placeholder for your content page.
|
|
|
|
|
The only problem is that my Master page also paint an lower icon bar for all the pages, so the content page comes in the middle and depending of it´s size it makes the Master change it's appearance, but I´ll check about Flow Layout
|
|
|
|
|
Hi,
I failed to manage roles by code and web confg. so I used the code easily I have a table Security of my database (login,password,profil) and a login.aspx page and I need to open pages in each service to the people of this service .is this correct? can I combine the files into folders?
I must change the file wb.config?
my code:
protected void Button7_Click(object sender, EventArgs e)<br />
{<br />
SqlConnection aCon = new SqlConnection(@"Data Source=.\SQLEXPRESS;UID=sa;Password=******;Initial Catalog=xxxxx");<br />
<br />
<br />
aCon.Open();<br />
String rqtr3 = " SELECT * FROM SECURITE WHERE LOGIN = '" + Textbox3.Text + "' AND PASSWORD='" + TextBox12.Text + "'";<br />
SqlCommand cmr3 = new SqlCommand(rqtr3, aCon);<br />
SqlDataReader drr3 = cmr3.ExecuteReader();<br />
<br />
while (drr3.Read() == true)<br />
{<br />
TextBox2.Text = drr3["PROFIL"].ToString();<br />
if (TextBox2.Text == "service1")<br />
{<br />
Response.Redirect("default1.aspx");<br />
}<br />
else<br />
{<br />
if (TextBox2.Text == "service2")<br />
{<br />
Response.Redirect("default2.aspx");<br />
}<br />
<br />
else<br />
{<br />
if (TextBox2.Text == "service3")<br />
{<br />
Response.Redirect("default3.aspx");<br />
} <br />
else.........<br />
<br />
}<br />
<br />
<br />
}<br />
<br />
}<br />
<br />
}
Thanks.
|
|
|
|
|
First, absolutely NEVER, EVER use unvalidated user input in your SQL statements. This is even more hanous because you are querying the security database. Lookup a term called 'SQL Injection attack'.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
even with an intranet? you advise me what?
Thanks
|
|
|
|
|
Even more so, most attacks occur from the inside
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Role based security is also available out of the box with ASP.NET
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks a lot Mark Nischalke and Jinal Desai - LIVE,
I used the link but when I login I have this message: Username / password incorrect. Please try again.(password and database connection are just)
I think that I have a problem with the web config.
Mark Nischalke I do not understand:Role based security is also available out of the box with ASP.NET.
thanks
modified on Monday, July 12, 2010 11:20 AM
|
|
|
|
|
|
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....
|
|
|
|