|
i want to create table in runtime
actually in web page, user will select colors and each color have number of sizes.
now i want when user colors i have to create the textbox equal to its sizes.
suppose the user have select red color and red color have 2 sizes then the datatable will be like this:
_____________________________________
|color| 0 | 1 | 2 |
_____________________________________
|Red | Textbox | Textbox | Textbox |
in the above table 0,1,2 are sizes of red color
i hope you got my question
One person's data is another person's program.
--J.Walia
|
|
|
|
|
your basic issue is that anything you create after or during page load, won't have viewstate. What do you want to do with colors ?
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 Friends,
I am developing a Intranet Application Which will run on local DNS Server, Many systems are connected to this DNS server , actually I want to get all Active System Ip Address which is issued from Local DNS Server..
Thanks
raushan
|
|
|
|
|
Request.UserHostAddress()
|
|
|
|
|
i'm trying to load a website in a webpart as the client choices withing my web site, for this what is the component that i can use in asp.net
|
|
|
|
|
got the solution, the iframe is the option
|
|
|
|
|
Hello,
I am using VS 2005
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel id="UpdatePanel1" runat="server" EnableViewState="False">
<contenttemplate>
<asp:TextBox ID="TextBox1" runat="server" Style="position: relative; top: 0px;"></asp:TextBox><br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Style="position: relative"
Text="Next" />
<asp:Button ID="Button2" runat="server" Style="position: relative" Text="Pevious" OnClick="Button2_Click" />
<asp:Button ID="Button3" runat="server" Style="left: 0px; position: relative" Text="Update" OnClick="Button3_Click" /><br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand='SELECT * FROM "EMP"'>
</asp:SqlDataSource>
</contenttemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button3" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
And in the aspx.vb file i have code following:
Protected Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
MessageBox.Show(TextBox1.Text, "xx", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
End Sub
but it is not showing me the current value (user chaged the value; when page comes on the browser) of the textbox; it is showing me the value which was at the time of page load.
After searching a lot on the net, i am posting the question here, to get the solution how to get the current/changed value of the textbox which is in the update panel; on click of the button.
Thanks & Regards
Girish Sharma
|
|
|
|
|
plz check whether you have checked the page load in your page load event....
code in c#:
if (!IsPostBack)
{
//Code
}
Padmanabhan
|
|
|
|
|
in the page load event i have following code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
Session("r") = 0
End If
'dv.Table.Rows(1)(1) = "xx"
showdata()
End Sub
Regards
Girish Sharma
|
|
|
|
|
try to put the showdata() inside the post back. that is the error...
code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
Session("r") = 0
'dv.Table.Rows(1)(1) = "xx"
showdata()
End If
End Sub
Padmanabhan
|
|
|
|
|
Thanks a lot padmanabhan N. It is working fine; but it is really new to me how it is working now; when page's postback event has been fired and i have following in showdata:
Public Sub showdata()
dv = CType(SqlDataSource1.Select(DataSourceSelectArguments.Empty), System.Data.DataView)
TextBox1.Text = dv.Table.Rows(Session("r"))(1).ToString()
End Sub
what is the relation with the postback's true/false?
I wish to thanks for providing the the answer and shall be more informative for the question i asked above please.
Best Regards
Girish Sharma
|
|
|
|
|
with pleasure,
The postback is doing all the things. The loop your write inside the postback will fire only when the page is loaded and the value will be maintained and the loop wont be executed after that. So, if we write the code after the loop will be fired in even and every postback. just keep the breakpoint in the page load and check. You can see for each and every postback the pageload event is fired.
So each and every time the button click it fires the page load first and then the button event. So, the showdata() will clears your modification and the original data will be set. For this only you got the old values.
I hope you understand now.
Padmanabhan
|
|
|
|
|
padmanabhan N
Thank you so much for clearing doubts and nice explanation.
Best Regards
Girish Sharma
|
|
|
|
|
its ok, Happy coding..
Padmanabhan
|
|
|
|
|
i am unable to connect database to my web page in visual studio. i have created a separate web form in my project. i add an sqlDataSource from the tool box . i just entered into configure data source option and created a new connection. i got an add connection pop up window in which i have selected sqlexpress as my server. i have selected my database name and when i click ok i am getting an error as follows
object reference not set to an instance of an object
|
|
|
|
|
where is the code you have used.... please make your question clear...
Padmanabhan
|
|
|
|
|
Sundar 2009 wrote: i am unable to connect database to my web page in visual studio
How did you tried to connect with DB? What problem are you getting ? You have to more clear and specific while asking question in the forum. Please read forum guidelines before post.
|
|
|
|
|
|
Hi...
Im given an assignment i wil b thankful if any1 helps me out...
I hav to create a login form in C#.net and the username and passwords r verified from the login table present in sql database... now as per the user logged in the edit,delete and insert option should be enabled or disabled in the grid view present in the form after successful login in....
for eg: if i log in as admin im given permission 2 edit,delete and insert. if i log in as a student im allowed 2 just view the records.. i must create the table in the sql database accordingly 2 satisfy these conditns...
Do any1 plzz help me 4 god sake..
Thanx in advance...
|
|
|
|
|
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
|
|
|
|