|
You can make use of anchor in HTML. Create anchor on the top of page, and link to yourpage.aspx#anchorname , will take you to the place where anchor is created.
|
|
|
|
|
Hi guys.
i can explain for my doubt with example.see.my table have multiple type of employee details like as Mangemment,Programmer,Designers,Accountants,Contra ctEmployees.Each type of department having many employee details.Now my drop down list having types of department names like that above types of department names..if i select any one type of department data wil be display in gridview format .gridview data column as employee Name,Address,Phone_No,email_address and each every row with checkboxes.gridview showing data according to select the dept.No problem.
first I select Mangemment type of employee grid view showing that type of employee details ,here i checked first two employee details then checkbox values put in one viewstate,then i go to Programmer type of employee it showing that type employee details here i want to checked two employee details using checkbox but what happened first two checkboxes are already checked. so view state having proper checked check box values but problem is
whenever i go to select for another type of employee details checkboxes are checked based upon order of previous checked index.
this is my problem.plz clear my problem.its very urgent.
whenever i select dropldown list viewstate values is empty . this is my problem.
Thanigaimani.thirumalai
|
|
|
|
|
Do you check checkbox values of dropdownlist selected event?
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi
i checked checkbox values of dropdown list selected index changed event,values are coming from viewstate,so we want viewstate values add plus new checked checkbox values ,but if i click display button control that viewstate values are removing then new checked checkbox values are only diaplay .
see my code behind..
i can bold where i used viewstate and i can underlined the code of viewstate values are removing( i mean previous page checked checkbox values).
<br />
<br />
<br />
Protected Sub gridview1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gridview1.PageIndexChanging <br />
<br />
gridview1.PageIndex = e.NewPageIndex<br />
<br />
getselected()<br />
<br />
databind1("First_name", "asc") <br />
<br />
setSelected()<br />
<br />
<br />
End Sub<br />
<br />
------------------<br />
<br />
Public Sub getselected() <br />
<br />
<br />
<br />
Dim arrayListContactGroup As New ArrayList <br />
<br />
<br />
If ViewState("ArrayList") IsNot Nothing Then<br />
<br />
arrayListContactGroup = CType(ViewState("ArrayList"), ArrayList) <br />
<br />
ViewState.Remove("ArrayList") <br />
<br />
<br />
<br />
End If<br />
<br />
For Each row As GridViewRow In gridview1.Rows <br />
<br />
<br />
<br />
Dim chkselectcontacts As CheckBox = CType(row.FindControl("chksel"), CheckBox)Dim arraylistlabel As Label = CType(row.FindControl("contid"), Label) <br />
<br />
<br />
<br />
If chkselectcontacts.Checked Then <br />
<br />
<br />
<br />
If Not arrayListContactGroup.Contains(arraylistlabel.Text) Then <br />
<br />
arrayListContactGroup.Add(arraylistlabel.Text)<br />
<br />
<br />
<br />
End If <br />
<br />
<br />
<br />
Else <br />
<br />
<br />
<br />
If arrayListContactGroup.Contains(arraylistlabel.Text) Then <br />
<br />
arrayListContactGroup.Remove(arraylistlabel.Text)<br />
<br />
<br />
End If <br />
<br />
<br />
<br />
End If <br />
<br />
<br />
<br />
Next <br />
<br />
ViewState("ArrayList") = arrayListContactGroup <br />
<br />
-------------------<br />
<br />
Public Sub setSelected() <br />
<br />
<br />
<br />
Dim arrayListContactGroup As New ArrayList <br />
<br />
<br />
<br />
If ViewState("ArrayList") IsNot Nothing Then<br />
<br />
arrayListContactGroup = CType(ViewState("ArrayList"), ArrayList) <br />
<br />
<br />
End If<br />
<br />
For Each row As GridViewRow In gridview1.Rows <br />
<br />
<br />
<br />
Dim chkselectcontacts As CheckBox = CType(row.FindControl("chksel"), CheckBox)Dim arraylistlabel As Label = CType(row.FindControl("contid"), Label) <br />
<br />
<br />
<br />
If arrayListContactGroup.Contains(arraylistlabel.Text) Then <br />
<br />
chkselectcontacts.Checked = True <br />
<br />
<br />
<br />
Else <br />
<br />
chkselectcontacts.Checked = False <br />
<br />
<br />
<br />
End If <br />
<br />
<br />
<br />
Next <br />
<br />
<br />
<br />
End Sub <br />
<br />
-------------------------- <br />
<br />
<br />
Protected Sub Selcon_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Selcon.SelectedIndexChanged <br />
<br />
getselected()<br />
<br />
databind1(ViewState("sort"), ViewState("ascdesc"))<br />
<br />
setSelected()<br />
<br />
<br />
<br />
End Sub <br />
<br />
My problem is,arraylist values(checkbox values) stored in viewstate,viewstate get the values no problem,but whenever i go to dropdown list select index change at that time we want add viewstate values and current checked checkbox values,but its doing opposite side operation i mean removing the view state value.see i can underlined that line.<br />
<br />
Plz urgent hepl me <br />
<br />
<div class="ForumSig">Thanigaimani.thirumalai</div>
|
|
|
|
|
Hi
i checked checkbox values of dropdown list selected index changed event,values are coming from viewstate,so we want viewstate values add plus new checked checkbox values ,but if i click display button control that viewstate values are removing then new checked checkbox values are only diaplay .
see my code behind..
i can bold where i used viewstate and i can underlined the code of viewstate values are removing( i mean previous page checked checkbox values).
Protected Sub gridview1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gridview1.PageIndexChanging
gridview1.PageIndex = e.NewPageIndex
getselected()
databind1("First_name", "asc")
setSelected()
End Sub
------------------
Public Sub getselected()
Dim arrayListContactGroup As New ArrayList
If ViewState("ArrayList") IsNot Nothing Then
arrayListContactGroup = CType(ViewState("ArrayList"), ArrayList)
ViewState.Remove("ArrayList")
End If
For Each row As GridViewRow In gridview1.Rows
Dim chkselectcontacts As CheckBox = CType(row.FindControl("chksel"), CheckBox)Dim arraylistlabel As Label = CType(row.FindControl("contid"), Label)
If chkselectcontacts.Checked Then
If Not arrayListContactGroup.Contains(arraylistlabel.Text) Then
arrayListContactGroup.Add(arraylistlabel.Text)
End If
Else
If arrayListContactGroup.Contains(arraylistlabel.Text) Then
arrayListContactGroup.Remove(arraylistlabel.Text)
End If
End If
Next
ViewState("ArrayList") = arrayListContactGroup
-------------------
Public Sub setSelected()
Dim arrayListContactGroup As New ArrayList
If ViewState("ArrayList") IsNot Nothing Then
arrayListContactGroup = CType(ViewState("ArrayList"), ArrayList)
End If
For Each row As GridViewRow In gridview1.Rows
Dim chkselectcontacts As CheckBox = CType(row.FindControl("chksel"), CheckBox)Dim arraylistlabel As Label = CType(row.FindControl("contid"), Label)
If arrayListContactGroup.Contains(arraylistlabel.Text) Then
chkselectcontacts.Checked = True
Else
chkselectcontacts.Checked = False
End If
Next
End Sub
--------------------------
Protected Sub Selcon_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Selcon.SelectedIndexChanged
getselected()
databind1(ViewState("sort"), ViewState("ascdesc"))
setSelected()
End Sub
My problem is,arraylist values(checkbox values) stored in viewstate,viewstate get the values no problem,but whenever i go to dropdown list select index change at that time we want add viewstate values and current checked checkbox values,but its doing opposite side operation i mean removing the view state value.see i can underlined that line.
Plz urgent hepl me
-- modified at 2:06 Thursday 8th November, 2007
Thanigaimani.thirumalai
|
|
|
|
|
hi,
The problem im facing is that when i open the solution of an asp.net project the .NET returns this error. "Visual Studio .NET cannot open or create the application. The likeliest problem is that the required components are not installed on the local web server. Im using Visual Studio .NET 2003 and Framework is 1.1.
thanx.
|
|
|
|
|
You need IIS installed (V 5.0 or higher if I recall). You also need to register ASP.NET with IIS using aspnet_regiis .
|
|
|
|
|
Hi,
try to repair your IIS
cd %windir%\Microsoft.NET\Framework\v1.1.4322
aspnet_regiis -i
if it is not working...
The VSWebCache folder is created automatically by Visual Studio when you open/create a web project and can be found in <root>\Documents and Settings\<user>\VSWebCache\<machinename>. Simply delete this folder and VS will recreate it when you attempt (now successfully) to open the web project.
-- modified at 6:53 Wednesday 14th November, 2007
-- modified at 6:55 Wednesday 14th November, 2007
Sherin Iranimose
|
|
|
|
|
private void SetConfigSettings()
{
string path = Server.MapPath("Web.config");
string newConnectionString = @"roles="+DropDownList1.SelectedValue+"";
XmlDocument xDoc = new XmlDocument();
xDoc.Load(path);
XmlNodeList nodeList = xDoc.SelectNodes("/system.web/location/system.web/authorization");
XmlNodeList nodeAppSettings = nodeList[0].ChildNodes;
XmlAttributeCollection xmlAttCollection = nodeAppSettings[0].Attributes;
//xmlAttCollection[0].InnerXml = txtKey.Text; // for key attribute
xmlAttCollection[0].InnerXml = newConnectionString; // for value attribute
xDoc.Save(path); // saves the web.config file
I gave the coode like that .But it willnot work.Plz help me.I want to change the roles in the allow tag that present in the subnode of authorization.How is it possible through the above code .What is the mistake.Thanks
|
|
|
|
|
Please don't repost. None here is going to take-up your work and do for you. we can give you some idea's to sort out your problem. what about this?[^]. Did you give a try?
Give a proper subject line like Accessing XML Nodes Using DOM . This will definitely turn other's attention.
Regards - J O H N -
|
|
|
|
|
SreejithAchutan wrote: I gave the coode like that .But it willnot work
It will work if you give the node path correctly. Your code works fine in my system.
Regards - J O H N -
|
|
|
|
|
Now I made an openfile dialog, I can choose every type of file.
But if I want to filer for open XML file only.
How can I do?
my code is
<asp:fileupload runat="server" id="filedialog">
<asp:button id="Button1" runat="server" text="Select" onclick="BtnSel_Click">
protected void BtnSel_Click(Object sender, EventArgs e)
{
if (filedialog.HasFile)
{
......
}
}
Thanks so much.
|
|
|
|
|
No. It is not possible to do.... but you may try ActiveX control or Flash for that purpose but it will work only IE and your site should be in trusted website list... i suggest that it is better if you don't do this...
|
|
|
|
|
Thanks so much
|
|
|
|
|
i have a hyperlink control , on clicking that , the user navigates to another page,Now before navigating to anothe page , i have some conditions , which i a writing in the source file in javascript (function is there in javascript ).after the satisfiction of all conditions, the user should navigate to other page, otherwise it should not.
how should i do this?
-- modified at 4:29 Wednesday 7th November, 2007
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
The hyperlink may have an OnClientClick function, I know a button does. In there you can write a function call to a method that returns true or false, and the return value will decide if the OnClick postback is called. If the hyperlink does not offer that, why not use an anchor tag instead of a server control, then you can have the link call a javascript method which redirects only if certain conditions are met.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i should not use the button control, it will not show me the data associated with the page (which i have binded with the page name (query string sort of things.)), the page , where i will redirect the user to some respective page.how can i use the anchor tag , to implement it?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
You may try by calling a function on the onclick event of the hyperlink.
Use following logic.
//Process
if (true)
window.location.href ="url"
else
//do nothing
Nitin
-- modified at 4:40 Wednesday 7th November, 2007
Don't Quit
|
|
|
|
|
You can disable hyperlink
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Good Day,
I need some help identiying the proper command terminology to create the type of page I would like.
What I am trying to do is take a format that will have data populated into it, but on the previous page I cache a session variable where I have "number of servers" and that number will determine how many times that template will appear on the next page with incremented servers names (i.e. server1, server2 etc...).
A link or even just the terminology so i can google it will work.
thanks
|
|
|
|
|
I have a Repeater control that hosts simple User List rows of system users. Each row has an Edit icon, which the user clicks to open a User Details edit page. I have been told to remove the separate details page, and create a detail edit section that expands or collapses on demand, without leaving the base User List page. How do I go about this?
My first idea is to include an edit control on the item template of the Repeater, and simply use styling to hide the edit control until the edit icon is clicked. Then I set the display to a visible, and the edit control handles all the edit functionality itself. Is this the correct approach, how could I improve on this, and what pitfalls await me?
|
|
|
|
|
Repeater Control doesn't support this. You can use DataList Control which has a selected Item Template where you can have the template to show the Details of the Selected Item. This will expand when you select the item and collapse the selected item when you select the other item by changing the selectedItem Index in the code-behind. And it has Edit-Item Template to edit the Item.
-- modified at 4:43 Wednesday 7th November, 2007
Regards - J O H N -
|
|
|
|
|
Thanks, I've been looking at the DataList, and will look at it some more now. How does this expanding and collapsing work if, say, the row is the last row in a 'window' (a fixed size div)?
I wasn't planning on supporting this through the Repeater, but through Javascript. All the Repeater would do is emit the hidden DHTML for the the rows and detail, it would be agnostic as to what was happening.
|
|
|
|
|
yes, Using repeater you can have the Details in the <-div> hidden and show them when you select the Item. this(expand and collapse) can be acheived through javascript. The page which we are using here in (CP) is something similar to the interface which you are talking. But I don't think you can provide the edit option using repeater control. you have to take the user to a different page for editing.
Regards - J O H N -
|
|
|
|
|
I will also be providing the edit function through Javascript. I already do this in other pages, with in-grid editing, using the blur event of the various controls.
|
|
|
|