|
Is this[^] what you need? There is an article[^] in CP as well.
जय हिंद
|
|
|
|
|
nofear5535 wrote: Im given an assignment i wil b thankful if any1 helps me out...
Is this a school assignment???
nofear5535 wrote: Do any1 plzz help me 4 god sake..
Please don't involve god for all these pity matters. You are capable enough to handle this all by your own.
nofear5535 wrote: i must create the table in the sql database accordingly 2 satisfy these conditns...
There can be many options. I would create tables like : UserDetails, UserRoles, RolePermissions
UserRole
UserID
UserName
FirstName
LastName
...
UserRoles
UserID
RoleID
RolePermissions
RoleID
PermissionType
This is just an example, but you may come up with your design too.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
gud day...
actually i must create a table dat has username & password.. If i login as admin i must be able 2 alter de gridveiw, for dis should i add any other additional column in database table hw do i make the username and password match and enable the alter option according 2 the user logged... Im using sql2005 and coding used is C#.net...
Do plzz help me...
|
|
|
|
|
nofear5535 wrote: hw do i make the username and password match
Use ASP.Net's login control (or have your own textboxes and labels) and ADO.Net to validate the UserID and password.
nofear5535 wrote: enable the alter option according 2 the user logged
Your database must have a table that relates each user to a role. Now each role will have certain rights (updating data in your case) in the application. When the user logs in, check the role and grant the rights that the role has.(Enabling disabling the update link or whatever you use).
There are plenty of articles on net that implement this kind of thing.
जय हिंद
|
|
|
|
|
Ok, let me make it more simple for you.
1.) Create a table(UserDetails) something like this
UserID
UserName
Password
IsAdmin
2.) Create a Stored Procedure with parameters username, password
Select * from UserDetails Where UserName = @UserName and Password = @Password
3.) Call this stored procedure from your C# code.
4.) Check if the result contains any row. If it does than the user has been authenticated[^].
5.) If the user has been authenticated, check if he is authorised for Administrator persmission. You will do this by checking the value of IsAdmin.
Well, this is the maxmimum I can do.
And I again suggest you to buy a book on C# and start reading. You may also look at some of the starter article at CP.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
nofear5535 wrote: wil b thankful if any1
nofear5535 wrote: hav
nofear5535 wrote: r verified
nofear5535 wrote: Do any1 plzz help me 4 god sake..
Don't talk like a retard, please. You're not on a phone, you have a full keyboard in front of you.
nofear5535 wrote: Im given an assignment
Is this homework ? Talk to your teacher, they should know you are this lost. Is it paid work ? What a disgrace, if permissions are in the hands of someone who has not the first clue how to impliment them.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hello.
I have an aspx page with a literal thet I'm building a table inside it.
the table rows come from db with an id num in each row.
Now, I want to add a button to each row that in his click will run a function with the id.
How can I add a button that on his click will run a server side function with the id?
Thanks.
|
|
|
|
|
Create the object of button class and set the relevant properties as you do in the markup. Also handle the click event for it. Then you can place it in the page(or any other container) using Controls.Add method.
जय हिंद
|
|
|
|
|
So, what you have tried for this? Create object of the button , assign unique ID , add event handler with the button and add them inside the table row.
|
|
|
|
|
Hi,
Sorry for the poor question before. My mistake.
The problem is that I'm programing for the web (asp.net) and I more easy with the winForm version of this.
I want each button the appear inside a row in the table with a unique id.
I am not sure how to create the unique button at run time.
For example:
I have the code (i replace the < with | since it look bad even in a code scope):
<br />
literal.Text = "|table|[LOOP START]|tr||td|I want to add button here |td||tr|[LOOP END]|table|<br />
as you can see, I'm creating the html tags of the rows in a loop. not the best way, I know, but thats what I have.
So how can I create all the buttons there?
Thanks.
|
|
|
|
|
polycom123 wrote: I want each button the appear inside a row in the table with a unique id.
Easy way is to use a grid view rather building the table yourself. Put the button in a template column and when grid view is generated, button will appear in each row.
|
|
|
|
|
N a v a n e e t h wrote: Easy way is to use a grid view rather building the table yourself. Put the button in a template column and when grid view is generated, button will appear in each row.
make perfect sense.
|
|
|
|
|
Happy Birthday friend
|
|
|
|
|
But I'm not sure I'm looking for the easy way,
I'm looking for the best way for me so it will look like I want it to look.
When I'm building my own table I have complete control over every thing and that's the easy way to build the table exactly like I want it to be (all the rows and columns with divs inside them and pictures and so on).
It worked pretty good until now when I need to add an action button for each row that will get the row information and send it to a server side function.
Thanks.
|
|
|
|
|
polycom123 wrote: I'm looking for the best way for me so it will look like I want it to look.
Whatever I said would be the best and easy way.
polycom123 wrote: When I'm building my own table I have complete control over every thing and that's the easy way to build the table exactly like I want it to be (all the rows and columns with divs inside them and pictures and so on).
Well, if you need more control over the HTML generation, use repeater. You can use a template column here and put the required controls and design.
As CG mentioned, problem with manually created tables are ASP.NET won't maintain viewstate for it. So either you have to create your table before page_load or stay with the controls what I suggested. When you use controls like repeater or gridview, viewstate will be managed by ASP.NET and you don't have to add extra coding for that.
|
|
|
|
|
Hi,
O.K. , I understand from the answers that the way I wanted to do this is not recomanded.
It was the must easy way for me so switching to repeater is a lot of work now
I'll will try to learn the subject to see if its less work to change every thing I did until now or start learning how to work with the repeater to achive the same resualt.
Thanks for the replys (to every one).
I really appreciate this
|
|
|
|
|
Your basic issue is that you need to create the button before page_load if you want events, othewise viewstate is not restored.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi guyzz...
Im actually about 2 code a project actually the asp form has got a login wid user name and password and a login button the login process should takeplace by checking the login table in the sqldatabase which has a list of user name and password and if it matches it must direct the user 2 the gridveiw page...
can anyone plz help me out.......Im doing it in C#.net....
thanx in advance....
|
|
|
|
|
nofear5535 wrote: Im actually about 2 code a project
You should buy a good book and start reading. It will help you in long run and make your skills better.
The question you hace asked is one of the first thing you would learn in ADO.Net.
Here [^]is one of the example which explains you how to do this.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
every thing about .NET and microsoft :
http://allaboutmicrosoft.net/
|
|
|
|
|
Voted to remove your message as advertisements are not allowed here. If you want to advertise, contact CP team to get a quote.
|
|
|
|
|
No advertisements please.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hey Guys,
I'm actually programming a little asp.net Homepage in vb, which should work as a File-Management System. This site has a Variable called Path which should allways be the working path. The Path variable is initialized on the page_load event when postback=false. It is saved as new Session("path")=Request.Physicalapplicationpath. When someone changes the path value, the session("path") is going to be updated. This all happens in an AJAX UpdatePanel.
My problem is that somehow the Session("path") Object is deleted --> Session("path") is nothing.
Do I have to edit something at the web.config for this to work? Or is there something wrong with postbacks?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack = True Then
Path = Session.Item("path")
Else
Path = Request.PhysicalApplicationPath & "PublicFiles\"
Session("path") = Path
CurrentDir.Text = Path
GetFiles()
GetDir()
End If
End Sub
|
|
|
|
|
The problem isn't your code but rather how Ajax handles session. Have a look at here, maybe it will help
ASP.NET AJAX: State or no State?[^]
only two letters away from being an asset
|
|
|
|
|
hi all
i have a XML and want to convert following xml to word
Code:
<XML>
<para>C<sub>2</sub>H<sub>2</sub></para>
</XML>the output is C2H2
2 is subscript
can any one suggest me code
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|