|
Hi,
If in the web.config file, you set authentication to Forms and LoginUrl to Login.aspx....and authorization deny users "?" ......Then client cannot go to other page without first going to Login.aspx.
Hope helped.
Happy Programming.
Sanjeev
|
|
|
|
|
i want biuld a tree view in asp.net(c#)visual studio 2003 and i want bind it from database how can u help me? i dont know how should i start
|
|
|
|
|
You can start with the control tutorials/documentations/examples.
|
|
|
|
|
I have a simple VB ASP.NET 2.0 page with a Button and a Label.
The Label text is "0". For each click of the button (btnAdd), it should
increment the Label text by 1.
The code:
Protected Sub btnAdd_Click(...) Handles btnAdd.Click<br />
Trace.Warn("Before add: " & lblCounter.Text)<br />
lblCounter.Text = (Int32.Parse(lblCounter.Text) + 1).ToString<br />
Trace.Warn("After add: " & lblCounter.Text)<br />
End Sub<br />
However, each time I click the button, the label always increase by 2 instead of the expected 1. What's the problem area?
I tried to debug using Trace.
I get the following result from the trace:
Begin Raise PostBackEvent
Before add: 0
After add: 1
Before add: 1
After add: 2
End Raise PostBackEvent
Is this signifies PostBack event is being run twice per button click?
How to solve it?
Thanks for your assistance.
Pedestrian, Penang.
|
|
|
|
|
hi,
i tried the same code out. i didnt get any probs as u mention. my code is here.
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Label1.Text = Val(Label1.Text) + 1
Label1.Text = (Int32.Parse(Label1.Text) + 1).ToString
End Sub
c there is no difference. but i am not having any probs. the out put is first 1 then 2 then 3 etc. i am not getting any result incremented by 2. c if u have all the property values correct.
love,
lavanya
|
|
|
|
|
Thanks very much for your help.
Pedestrian, Penang.
|
|
|
|
|
Hi,
I've had similar problems in the past with updating data. Its not a 'problem' as such that can be solved and sounds more like a case of how and when you are binding data / incrementing the values.
In most cases it is to do with the fact that you're increment code is being called twice. How and when this occurrs i couldnt tell you because it is of course specific to your page / code.
The simplest - although perhaps most time consuming solution - is to rebuild the page from scratch. Implement the incremental code at the earliest of opportunities whilst there is minimal additional code associated with the page. This will make it much easier to work out exactly what is going on.
Hope this helps.
|
|
|
|
|
Thanks for your help.
Pedestrian, Penang.
|
|
|
|
|
I'd also make sure that there isn't another delegate registered on the page for that event, could force it to call twice.
|
|
|
|
|
Thanks.
Pedestrian, Penang.
|
|
|
|
|
i want design a form with this name(Frm_arrangment) and this duty:
i want change the color of textbox or color of datagrid or font of label and other componet that i use in all of my forms by form Frm_arrangment. i think about the layout of Frm_arrangment but i want to know your idea about layout of this form can u help me with more model and example|?
|
|
|
|
|
Hi All
Java Script Error...
I am using AJAX and i am getting problem at:
//Add new states list to the state combo box.
for (var count = 0; count < stateNodes.length; count++)
{
textValue = GetInnerText(stateNodes[count]);
alert(textValue);
optionItem = new Option(textValue,textValue, false, false);
cmbstate.options[cmbstate.length] = optionItem;
}
it is not loading cmbstate from return response. Please note textvalue is coming and moreover cmbstate is correct name.......
Any thoughts...
Amit
|
|
|
|
|
Standard question #2:
What error message do you get?
What is "cmbstate" the correct name for? Do you create that variable somewhere, or are you just trying to access an element as if it was a variable?
---
b { font-weight: normal; }
|
|
|
|
|
Hi Folks -
Here is what I want to do. I'm hoping someone out there knows what the best way to achieve my desired results is.
TOOLS
Development platform is of course Visual Studio 2005 on XP Pro (sometimes Vista RC1) with dot net 2.0.
MY PROBLEM
I have created many user controls that are essentially report summary panels that display various types of info and or controls in a table - the actual functions are not important. Each user control has many common UI elements - they are all in a table, they all have a title header, they all have a link in the header to show or hide the results and a link to a form to create or edit a record. They all have properties and methods that set the title, respond to the links etc. Since they are all so similar it seems obvious that a more OOP approach is warranted but I'm at a loss as to how best to proceed.
DESIRED SOLUTION DIRECTION
With the concept of the master site page and replaceable content pages in mind is there a way to build a master user control that captures the common elements and then develop user controls for the specific content that inherit the common elements from the master control? As I evolve the common elements I want all the user controls to inherit the UI elements from the base control as well as the common properties and methods in the base code behind file. The master page concept is such an elegant solution at the page (.aspx) level it only seems logical there should be a similar solution at the user control (.ascx) level.
I've spent the last 2 days reading various MSDN articles and USENET listings and none of the approaches I've read so far seem to address my requirements. The closest seems to indicate that I need to create a class that will write the common HTML out to a placeholder on my control but that bypasses the desired goal of using the visual designer.
I hope one of you gurus out there has a really slick and simple solution to my problem.
Thanks in advance,
Michael
|
|
|
|
|
can somebody help me out i trying to figure out how i can use ajax to load a new img without a postback
Thanks,
Chad Aiena
|
|
|
|
|
You can't use AJAX to load an image.
If you need a call to the server to find out the name of the image, you can use AJAX, but the loading of the image itself is done by the browser.
If you don't need a call to the server to find out the name of the image, you don't need AJAX at all.
---
b { font-weight: normal; }
|
|
|
|
|
perhaps this be your answer :
var img=new Image();
MyImage.src="newImage.jpg";
function Change()
{
document.images[0].src=MyImage.src;
}
now you can call Change function to load new Image without postback.
|
|
|
|
|
Hi..
How could we make solutions for the following actions using ASP.NET 1.1 ? :
1-User Forgot his Password.
2-User choosed to Save his Password.
I am too late but i will never give up
|
|
|
|
|
Hi,
Are you using Forms Authentication???.........If you go and check forms authentication you should be able to do this....
Good luck
Happy Programming
Sanjeev
|
|
|
|
|
Thank you for your respond..
Yes Iam using Forms Authentication.May you explain to me at least the solutions ideas?.
I am too late but i will never give up
|
|
|
|
|
i have web-form control namely textbox1 ,and button1
if user enter 4 in textbox1 and click button1
then 4 text box will appear on client side
omi
|
|
|
|
|
I don't have the foogiest idea of what you are trying to say.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I'm building an application for students to answer test questions, and later get feedback on their learning. I have an SQL database holding the questions and their associated multiple choice answers. Answers to each question have an integer ID number, starting at one. The correct answer is always ID 1.
I want to be able to display the multiple choices in a ListBox, in a random order. At the moment I have an SQL call to the database to extract the appropriate answers, ordered by NewID (random). These fill a DataSet and this is then used to fill a Hashtable of the AnswerID and Answer Text pairs.
While the items are placed into the Hashtable in the random order that they were retrieved from the database, they seem to reorder themselves numerically once in the Hashtable. Therefore when my ListBox (showing only the answer text) binds to the Hashtable it always shows the correct answer in the last slot in the list.
How can I ensure that the items in either the Hashtable or the ListBox are randomized?
Many thanks,
Alice
|
|
|
|
|
The data in a hash table is stored according to the hash code of the keys, so if you have the same keys, you will always get the same order. If you want to maintain the order that the data was fetched in, don't use a hash table.
I would not put the correct answer as always having id 1. If someone views the source of the page, it wouldn't be that hard to figure out the pattern.
---
b { font-weight: normal; }
|
|
|
|
|
hi all, i have a problem need your help.
How to insert a menu created by sothink dhtml menu in a asp.net page created in Visual Studio 2005.
Thanhks in advance
|
|
|
|