C# - Extending Textbox To Have A Unique Name?
Aug 23, 2010Is it possible to Extend Textbox to have a Unique Name ? I have tried using UniqueID poperty,but this is not accessible with Request.Form("UniqueID")
View 2 RepliesIs it possible to Extend Textbox to have a Unique Name ? I have tried using UniqueID poperty,but this is not accessible with Request.Form("UniqueID")
View 2 RepliesI am beginner in web applications development. I started one little project and host it on source forge "https://homoco.svn.sourceforge.net/svnroot/homoco". And I started implementing authentication in this application to learn how it works. From my experience people never use out of the box things so I want to implement this stuff alone (like in real world projects). So some questions:
1) Is there any reason to use membership out of the box? To use database table schema, stored procedures etc. that tool generate for developer. I think that this lower control over code and I decided to implement it my self. I don't know if I am right.
2) Is my approach in this demo project good or bad (if someone have time I like to do just a little code review)? I created database based on business rules. Not using database schema that membership provider require. Extend "MembershipProvider" class to satisfy my needs. Implement queries to database myself.
3) Now, this question is a little wired but I have to ask it. If we make custom Membership Provider and do sql queries alone, implement all MembershipProvider class methods ourselves, and in application use Membership.blabla() why is this approach different from not extending MembershipProvider class and putting all this methods in some unique class and call its methods then? I hope that someone understand what I ask here.
I am sorry for three questions, but I really trying to find the best way to implement this feature in my demo project like it is a real world application.
i like to have unique ids for textboxes and hidden filds .is there any property which will give unique id in asp.net ?
something like
<asp:textbox id="ctr001_1" runat="server" uniqueid="textbox" />
i need code to be able to check if (the date in a textbox) is already (used) in the database or not, if yes then give an error message!!
i am using asp.net 3.5 c#
what the best way to create text boxes in my loop here so that the IDs are unique instead of just "TextBox" for all of them. I need to add up the Price based on the Price per unit and the Quantity.
My items are loaded from a database so there could be any number of them, so I need to generate the fields on the fly. I was thinking maybe an array of fields could be used like in a form application, or is this not the right way to go?
Here is my code:
[code]....
When a user enters a value I want to check against the other values in the database before allowing the record to be inserted.
It is a nvarchar type column.
Is it best to use a unique constraint (if so, how) or what would be the way to programatically check to make sure this name does not exist. It is not a username, just a name value that will be used in routing.
How to get Unique ID of LDAP logged in User? Is GUID is the unique id of each user?
View 1 RepliesIs GUID (globally unique identifier) really unique, or it can be duplicate.
System.Guid.NewGuid().ToString()
How generate the unique no. 1,2,3 and so on .... on button click of each new user ..
the code mentioned below is a readwrite coding in vb.net ...
but the problem is it generate the same id for different users on button click event... but i want the no. of times button clicked the new ids will be generated
[code]....
How can I get unique session ID for every unique user who logs in ?? I'm using asp.net/c#
View 1 RepliesHow To Display Data In Following Format?
In the Format below abc has multiple occurance which count is displayed in brackets as 2669.
[code]....
I am here with a task to generate a unique no of specific length from another unique no.
I want my target unique no of say z length to be generate from combination of a unique no [ that may be a serial no ] of say x length and any secret key of say y length.
I've been recently tasked with leading an effort to improve our input (and output) validation with OWASP recommendations and PCI compliance in mind. In the process, I'm trying to assess the value of the ESAPI.NET project which does not appear to have seen any activity since the spring of '09 and as it stands is incomplete.
Does anyone have experience using or extending ESAPI.NET v0.2? Is it a good starting place today for building out an infrastructure to address the targeted vulnerabilities?
FYI: I am looking at MS AntiXSS which, of course, only addresses a portion of ESAPI's scope. We already do a good job with SQL injection though there are improvements we need to make.
The GetRolesForUser() method in the RoleProvider takes the user login name and returns the list of roles for that user. But in my application this is not enough, I need a few more pieces of information to be able to get the user's roles. How can I get this extra information into the method? I have it in the Session, but I found out that Session is not available in the RoleProvider.
What I had in mind was putting this extra info in some class that extends MembershipUser, assuming I can get to it inside the RoleProvider. But I don't know how to create the CustomMembershipUser and make it part of the MembershipProvider. Is this even possible? The easy way out would be using cookies, but I'm trying to keep away from it.
When people talk about extending a control are they just talking about inheritance?
View 1 RepliesI have a rather large application that has literally a hundred DDLs with Yes / No ListItems. In an attempt to save myself some time, I created a custom control that extends the standard DDL.It all seems to work fine but I am having some issues when assigning the SelectedValue property in code where the selected value does not seem to have an affect on the control. I wonder if I should be adding my items during Init or PagePreLoad? Should I be calling base.OnInit before or after I add the list items? This mostly works but not 100%. (v3.5)
public class YesNoDropDownList : DropDownList
{
protected override void OnLoad(EventArgs e)
[code]...
When you create a webpage in ASP.net, the codebase inherits System.Web.UI.Page
Now when I extend the page object to check for SessionExpired for example, I create a new class and inherit from system.web.ui.page, and overwrite some functions.
The problem then is that on each page, I have to replace system.web.ui.page with my custompage class.
Is there a way to extend a class by adding methods or modifying its methods directly (e.g. add the sessionExpired check to System.Web.UI.Page) ?
I'm using .NET 2.0
I use two different collapsiblepanelExtenders with similar colapsedControlID which is not a matter here. ince both of them working but with some misbehaviour, for example if the first one is open and I click wherever on it , the second one extends. also by clicking on the second one it collapses.That means that some how an event triggers and makes them collapse or extend.I have a kind of editing panel inside each extandedPanel which are used to update something on the page. the problem is that by clicking on eachtextbox or fileupload, the second panel collapses again. before any other action. So that I can not enter the textboxes. I can do that if I use tab button on keyboard. but that sucks really.
[Code]....
it might be because the second extender is inside the collapsible panel itself. but why it doesn't stay in extended state?
I have been developing a pure MVC CMS for fun and have run into an annoying bug/feature of ASP.NET routing.Each dynamic managed page in my CMS is associated with a particular route that is pulled from the database. These are loaded at app start. When a user adds a new page or edits the Url of an existing page I need to be able to edit the RouteTable to insert/edit route accordingly.The problem is that the new route does not need to be simply added to the end of the RouteCollection, instead it may need to be inserted into a particular position. Seems logical enough except that the RouteCollection contains only a standard Insert(int idx, RouteBase route) method inherited from Collection<T> which doesn't contain the route name. The name of the route is important as I use it throughout to generate action links.Looking at reflector I can't see an easy way to extend this collection as the _namedMap dictionary is marked as private. I tried chopping the collection at the point of insert and re-adding each item again, however because there is no method to reverse lookup a route's name from the RouteCollection I cannot re-add them with the name they may have had before. So frustrating!!!Why is the name of the route not a property of the route object?Why if MS is serious about us extending MVC and Routing do they make crucial classes hard to extend?Any suggestions as to the best solution here?Edit :Ok maybe I should have been much much clearer here. I am not looking for a critique of my CMS design. I appreciate the comments but this is not what I am asking.
View 3 RepliesI were following the tutorial at this page of how to build my own view engine: [URL] And in hope of just extending the existing RazorViewEngine I made some changes to the code in the tutorial...
[Code]....
The thing is that now when I run my site..I get the following error: CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?) and I just cant find a way to solve this..I have added the references.
We have an ASP.NET 2.0 site in which we use ASP.NET login / authentication controls.
Our users currently timeout after approx 20 minutes, forcing them to log back in, and this appears to be causing downstream errors in our application.
I have tried increasing the SessionTimeout value to 120 mins (<sessionState timeout="120" />) in the site's web.config file, and the "<membership userIsOnlineTimeWindow="5000" >" value in the web.config is set to 5000 minutes.
These are the only values / settings I can think of to affect this behaviour.
I am trying out ASP.NET MVC2. I have a controller called SearchController and a view folder called Search containing Search.aspx. In my controller I have:
[code]....
In my view I have:
<form action="Search/Post" method="post">
<label><% Response.Write(Model.Title); %></label>
<input type="Submit" Value="First" Name="submitButton"/>
</form>
It works fine the first time I click the button, and the browser shows a url of [URL]. However, when I click the button a second time the browser url changes to [URL] and I get a 404. What am I doing wrong?
am having an argument at work on the asp.net membership provider.One of my colleagues says we should modify the tables and add our own custom columns, and i prefer we create additional tables and add relationships.
View 1 Replies1) Extend the CreateUserWizard control to insert additional User fields (eg. Gender, Age, Occupation, Address, Phone, etc...).
OR
2) Create a brand new Custom Membership Provider of my own and skip using the inbuilt ASP.NET membership system.
What is the best way to create a new User system with my own tables of User data as described above?
Should i perhaps still use the standard ASP.NET membership system and then extend my own Registration page to add more User data to my own SQL backend table using the Identity value inserted into the aspnet_users table?
I extend LinkButton and i get this error:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.