|
I kind of got that to work but now I want to use those fields to remove and add columns to the gridview. If I hard code the checkboxlist it works fine but this way is more difficult see the button click event below:
Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim li As ListItem
Dim liNum As Integer = -1
Dim colNum As Integer = -1
For Each li In CheckBoxList2.Items
liNum += 1
colNum += 1
Select Case li.Value
Case liNum
If li.Selected Then
GridView1.Columns(colNum).Visible = False
Else : GridView1.Columns(colNum).Visible = True
End If
End Select
Next
End Sub
This is the code for creating the checkboxlist:>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim listItemCount As Integer = -1
Dim totalColNum As Integer = GridView1.Columns.Count
Dim valNum As Integer = -1
totalColNum = totalColNum - 5
If Not Page.IsPostBack Then
While listItemCount <= totalColNum
listItemCount += 1
valNum += 1
CheckBoxList2.Items.Add(GridView1.Columns(listItemCount).ToString)
CheckBoxList2.Items.Item(listItemCount).Value = valNum.ToString
End While
End If
End Sub
I tried to update the value of the created items using:
CheckBoxList2.Items.Item(listItemCount).Value = valNum.ToString
But it does not seem to work.
|
|
|
|
|
dear guys,
i have two ASPX pages, "FORM_A" and "FORM_B"
In FORM_A, i have one command Button, When the button is Clicked,
i'm Opening the FORM_B,
FORM_B Has TWO TEXTBOXES[for collecting the User inputs], OK AND CANCEL BUTTON
when the user clicks the OK Button in FORM_B after entering the Inputs in Textboxes,
i want to refresh or reload the "FORM_A" by coding [client side script and server side script]
could any one give solution for this
Thank u,
Sansadhan
|
|
|
|
|
|
Thanks Mr.Mike, it's very helpful for me.
Now Again One more question
There is two forms , "FORM_A" and "FORM_B"
In FORM_A i'm Having one Report and a button control
when user clicks the button the i'm showing the FORM_B
and collecting the Data in FORM_B
when the user Close the FORM_B
what i have to do is
i want to show the collected data in report. Report is created at server side
i want to send the data to server and recreate the report and bind the report to the "FORM_A".
How to do this
Kindly Provide me solution
|
|
|
|
|
Why not have it on one form? Have a Panel with an id of something like panelCriteria and a second Panel on the page panelReport. When users click your "criteria" button, have your event handler hide panelReport and display panelCriteria. Then, when the users click "OK" or "Display Report" (or whatever you'd title that button), have the event handler hide the panelCriteria and display panelReport. Because it's all on one page then, the report will have all the criteria control values available to it.
|
|
|
|
|
Hi
How to pass values between two pages with out using Querying string and session in ASp.net.
|
|
|
|
|
|
Hi,
you can use cookies or you can java script to post the values to another page, on that page you can read the values.
Ram
|
|
|
|
|
1. Until now I'm setting the Control page like this:
<%@ Register TagPrefix="Menu" TagName="Bottom" Src="Bottom.ascx" %>
On the top of the page.
But now I need to set the Src dynamicly.
eg.: <%@ Register TagPrefix="Menu" TagName="Bottom" Src="Session["ID"] + "/Bottom.ascx" %>
Something like this.
Now I know that this is not how to do it, but maybe you can help me?
2. I now need to create buttons dynamiclly, according to a database.
Well, creating them is the easy part.
But when I postback they just disapear... someone know why? and how can I fix this?
thanks alot! NaNg
|
|
|
|
|
1. Use the LoadControl to load the control dynamically in code behind:
Control menu = Page.LoadControl(Session["ID"] + "/Bottom.ascx");
Then add the control to the page.
2. You have to create the buttons every time the page is created, not just the first time.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa's suggestions are terrific here. Just to add some perspective to your second question: keep in mind that the web is a stateless environment. Each postback to an .aspx page is in reality a separate request of the web server, so the server needs to construct a complete page in response each time.
When you declare controls, using syntax like <asp:Button runat="server".../> , you leave it up to the page parser to create the necessary Button object. And the page parser does just that, on each request, regardless of whether it was a first time request or a postback.
When you instantiate your own controls in code (like creating a Button), you're effectively taking on the responsibility that the page parser normally has under declarative circumstances. And like the page parser, it is up to you to recreate those controls on each request, regardless of whether or not the request is a postback.
|
|
|
|
|
I'm using the ASP.Net SiteMapProvider, and is really easy ask to ASP.Net generate one sitemap file to google use. I tell to google access http://www.mydomain.com/sitemap.aspx in order to get the sitemap.
But about the robots.txt? The asp.net cannot handle this extension... I wish really one solution what does not need to do changes in IIS because the web sites are in a hosted enviroment.
Someone has one solution? In robots.txt has some special syntax to get your info from another source? By example, in robots.txt I place one "link" what tells Google (and other crawlers) read the robots.txt contents from the robots.aspx file (then I can generate this file contents dinamically)
Regards
Jesus is Love! Tell to someone!
|
|
|
|
|
I have a gridView.
CheckBox is attached with each row.
I have a button.When i click on that button All checkbox are selected.
Problem is in delete checkbox.I want that when i click on delete checkbox button all selected checkbox rows will be deleted.
Can anybody have solution.
Thanks in advance.
kartik rathi
|
|
|
|
|
Where exactly is the prolem? In selecting all the check boxes or in deleting all the selected records? For the second problem you can send the comma separated IDs of the records which later in your storedprocedure can split and then delete using cursors.
Best Regards,
Apurva Kaushal
|
|
|
|
|
hello i have one problem..
i read so many article on usert control but not getting how to achieve this?
Upload new modules
i) Each module consist of ascx (asp/net user controls) & programming script and database script – modules can be any programming/database (PHP/mySQL or ASP/mySQL or ASP/Access or PHP/Access or Asp.net/MS SQL etc etc ) – every time a new module is added the super admin can specify the programming and or database
(1) Admin should be able:
(a) to upload ascx controls for backend administration and PHP User Modules with database script file
(b) Publish Modules to all accounts or to select accounts only
Plz Any One Can help me to do this..or give me any idea for doing this.
i'm working on CMS Project.
thanx
|
|
|
|
|
Hi Is there any way to make Address bar of browser in read only mode .....
using Asp.net 1.1 or Asp.net 2.0
Urgent ....
|
|
|
|
|
I don't think that you can make the URL readonly. But why exactly you want to make that readonly?
Best Regards,
Apurva Kaushal
|
|
|
|
|
let take example :-
i have url like
www.domainname.com/admin/Page1.aspx and
www.domainname.com/sa/Page1.aspx
and let say user is login to application having url in broswer
www.domainname.com/admin/Page1.aspx and the same user know this
other url of site i.e www.domainname.com/sa/Page1.aspx and if he made changes
in browser address bar by replacing admin word by sa still he see that page and which i want to avoid ... Is there other
way to avoid this ....
|
|
|
|
|
You can have check for the user credentials in the page load event i.e if a user is a normal user and trying to go on the admin page then you trap that in the load event and then redirect him to the login page.
One other way is to rewrite the URL but again it won't be of that much effect as user can event track the rewritten URL also.
Best Regards,
Apurva Kaushal
|
|
|
|
|
|
always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
hello apurva,
i need ur urgent help.sorry to interupting in any other thred.
i have one problem..
i read so many article on usert control but not getting how to achieve this?
Upload new modules
i) Each module consist of ascx (asp/net user controls) & programming script and database script – modules can be any programming/database (PHP/mySQL or ASP/mySQL or ASP/Access or PHP/Access or Asp.net/MS SQL etc etc ) – every time a new module is added the super admin can specify the programming and or database
(1) Admin should be able:
(a) to upload ascx controls for backend administration and PHP User Modules with database script file
(b) Publish Modules to all accounts or to select accounts only
Plz Any One Can help me to do this..or give me any idea for doing this.
i'm working on CMS Project.
thanx
|
|
|
|
|
check out this link
Securing Directories with Role-based Forms Authentication
http://www.codeproject.com/aspnet/formsroleauth.asp
Hope this will help u
Navin
|
|
|
|
|
Hi, good day...
I'm using asp.net 1.1 (VB) to do the project.
I got a datagrid in my page, one of the column of the datagrid is editable. My question is, i don't want the edited data to be store back in my database. I got an idea is to store the value in dataset and then rebind the datagrid with it.
But I don't know how the code looks like. Can anyone help me to solve this?
Can you plase show some sample code to guide me? Thanks.
Best Regards,
Pei Sun
|
|
|
|
|
What you can do create a dataset(table with all the columns) and then bind the datagrid with this dataset and do the update operations in that dataset. You can maintain that dataset in session.
Best Regards,
Apurva Kaushal
|
|
|
|