|
The first two you would need to call and then use the returned values to set properties on the control, the third you would get a table back and data bind in the usual way.
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 )
|
|
|
|
|
Hi Christian,
Thanks a lot for your time in reading my post and replying to it. I'm still struggling with populating the header of the gridview from the table. My table structure is :
____________________
PhaseId PhaseName
____________________
1 Scope Closure
2 Functional Design
3 Techical Design
4 Alpha Testing
5 Beta Testing
6 UAT
In the header of the gridview I need:
===================================================================================================
TemplateHeader1 | TemplateHeader2 | Scope Closure | Func. Design | Tech Design | Alpha | Beta | UAT
====================================================================================================
TeamplateHeader1 & TemplateHeader2 are template columns for checkbox and label. Scope Closure onwards come from the table.
Also, The colors for the cells from 'scope Closure' to 'UAT' have to come from the PhaseColor table depending upon the status of phase e.g. AtRisk=Red color, OnTrack=green color etc... first two Template columns and their cells have to stay white or whatever the grids background color is.
Is gridview right for such functionality?or is there another alternative to it? In classic ASP the previous person has used elements to achieve the desired result.
Thanks for your help once again.
Aartee.
...HE is watching Us All!
|
|
|
|
|
hi, in my BLL i need to create a function that returns a datarow not dataset so that i could read in my aspx page and check if the user exists below is my function currently returning dataset and in aspx page i use dataset.tables(0).rows(0).item("username") and i think its not necessary to use dataset. could someone please help?
Friend Function getUserLogon(ByVal username As String, ByVal password As String) As DataSet
Dim param As SqlParameter
Try
con = New SqlConnection(ConnectionString)
Dim dt As DataSet = New DataSet
Dim cmd As SqlCommand = New SqlCommand("getUserLogon", con)
cmd.CommandType = CommandType.StoredProcedure
param = New SqlParameter("@username", SqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = username
cmd.Parameters.Add(param)
param = New SqlParameter("@password", SqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = password
cmd.Parameters.Add(param)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
da.Fill(dt)
Return dt
Catch ee As Exception
Throw ee
Finally
con.Close()
End Try
End Function
|
|
|
|
|
The ideal method for login takes the username and password and returns a bit to say if the login succeeded or not. I can't imagine why you wrote a proc that returns a dataset. Or did you not, and you just don't know how to run it to return just one value ? ExecuteScalar() is, I believe the method you call to run a proc that returns a single value.
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 )
|
|
|
|
|
thats correct. i could have used executescalar but i need to store the username in the session n cookie.
|
|
|
|
|
You HAVE the username, you're passing it in to the function.
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 )
|
|
|
|
|
Hi I am learning to code in ASP.NET 2.0 with C# and trying to figure out how members can send and receive internal email to each other? Each member should have a dynamically allocated userid to track, but I'm still learning how to set up that profile page as well.
Can anyone help?
|
|
|
|
|
Why is it that the people with ids like 'ASPMAX' are the ones least likely to do some basic research before flooding these boards ?
Buy a book on ASP.NET, work through it, and then worry about stuff like this once you have a basic understanding of how things work. Really, I can't answer your question without raising 20 others that are better answered by working through a beginners book.
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 )
|
|
|
|
|
How is my basic question flooding? I've purchased two books. Murach's ASP.NET 2.0 C# 2005 along with an SEO ASP.net book.
Neither really explain how to pass data over in detail. They give examples of shopping carts, but I don't fully understand the C# code.
Since it seems so tedious to ask you a simple link, guide, or reference to any website, can you recommend a book? Or simply recommend what keywords I should search on Google to find such examples?
I HAVE been looking, for 2 weeks actually, hence my frustration in posting on here, since you guys seem to know it all.
I did find one example of how to pass data from one page to another.
Sh*t, I didn't think that was a tedious question. A few simple links or recommended keywords would be a start.
Someone sure woke up on the wrong side of the bed. Don't get your panties in a wad.
|
|
|
|
|
Hi everyone,
I'm very new to C# and ASP.NET. I am trying to create a dating site, where the user goes to a signup page, and they can enter info into the fields, but
how do I get that info passed over to the 2nd page, and then once they are done, save it in the database?
I know how to setup the database, and have a table setup with all the requirements but I haven't been able to find how to have the createprofile.aspx page pass that data correctly into the database?
Also, I want this page to then dynamically create a user profile page saved as an .html where the page dynimcally creates a member000001, member000002, and so on page.
Does anyone have any code that can do this??? I'm stuck.
|
|
|
|
|
Dear Programmers,
I am getting mad now to get what I want. I have searched 100 of articles but not found my desired one. I am using a gridview and want to give use a linkbutton as providing the option to the user to move the data of the rows of gridview up and down.
To give a better understanding I am giving you an example. I want that if user press the Up (LinkButton) Button on the gridview in second row than the data of second row will be shifted to first row and data of first row will be shifted to the second row. I am also giving you my code. In this I only want to get the indexposition or row position on which I am pressing the Up or Down Button. Please Help me to get rid of it otherwise I will be get mad because I am trying to get this from more than a week.
My code of gridivew is:
<asp:gridview id="dgUser" runat="server" autogeneratecolumns="False">
Width="400px" >
<columns>
<asp:templatefield headertext="Delete">
<itemtemplate>
<asp:checkbox id="chkDelete" runat="server">
<headerstyle font-bold="True">
<asp:templatefield headertext="HeadLine">
<itemtemplate>
<asp:textbox id="cgrid_headline" runat="server" enableviewstate="true" text="">]]>'>
<headerstyle font-bold="True">
<asp:templatefield>
<itemtemplate>
<asp:linkbutton id="lnkUp" runat="serveR" font-underline="True" forecolor="Blue" text="Up">
Visible="<%# IIf(CType(Container, GridViewRow).RowIndex = 0, false, true) %>" >
<asp:templatefield>
<itemtemplate>
<asp:linkbutton id="lnkDown" runat="serveR" font-underline="true" forecolor="blue" text="Down">
Visible='<%# IIf(CType(Container, GridViewRow).RowIndex =8, false, true) %>' >
Please friends help me. I will be thankful to all those in advance who will reply me.
Thankyou.
|
|
|
|
|
Although i haven`t worked with a scnerio as above , I once designed a page where the grid contains a dropdownlist and on its selection change i had to get its index. Following is the code...
ASPX Page
....
....
<Columns>
<asp:TemplateColumn HeaderText="Action">
<ItemTemplate>
<asp:DropDownList id="DDAction" runat="server" OnSelectedIndexChanged="DropDown_SelectedIndexChanged"
AutoPostBack="True"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
ASPX.CS
protected void DropDown_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList list = (DropDownList)sender;
TableCell cell = list.Parent as TableCell;
DataGridItem item = cell.Parent as DataGridItem;
i=item.ItemIndex;//you get the item index..
....
....
When you fail to plan, you are planning to fail.
|
|
|
|
|
Hi all,
I have a tricky problem here. I have a parent page from where i select a value in a DDL and pass it to a child page(new window) when user clicks a radio button.The child page contains a search functionality where the results are displayed in a grid view. The grid view contains a textbox as a template column where the user enters some value. When the user clicks Save button i need to save the details entered by user in a dataset(not a problem)..
But also on save i have to close the current window and display the results in parent page. Is there a way i can call an event of parent page to display the datagrid with a click event in child page????
Thanks in advance.....Any help would be appreciated....
When you fail to plan, you are planning to fail.
|
|
|
|
|
Yeah there is. Redirect the parent page via javascript. You can pass any value from the child window via query string or session.
//Javascript
function closeMe(loc)
{
if (opener && !opener.closed) opener.location.href = loc;
window.close();
}
// C#
this.Page.RegisterClientScriptBlock("key", @"closeMe('http://www.google.com? + put your parameters here');");
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
I am a beginner in aspx with c#. Pls check the link below
------------------------------------------------------------------
http://www.codeproject.com/KB/selection/MonthCalendar.aspx?fid=194080&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=351#xx0xx[^]
---------------------------------------------------------------------
The last fifteen days i searched this type of calendar control. Really its excellent. But i do not know how to use this control in VS2005. Can anyone explain step by step to use this control in VS2005? In advance thanks alot.
|
|
|
|
|
This is a windows control. You wont be able to use it in your web application.
*jaans
|
|
|
|
|
To use a calendar control in ASP.NET, it needs to be written in javascript. Google, there are tons of them out there.
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 )
|
|
|
|
|
Hi
I have the following hyperlinkfield:
<asp:hyperlinkfield datanavigateurlfields="Item_Ref, Item_Description" datatextfield="Item_Ref" headertext="Item_Ref" sortexpression="Item_Ref" datanavigateurlformatstring="~/Main/RoomCompdets.aspx?firstvar={0}" target="_new">
how would i add in some code which would open the new window to a certain size thanks
|
|
|
|
|
Go through the following page..
Using the window.open method[^]
Please search over the net to find some resources before posting questions.
*jaans
|
|
|
|
|
thanks for the reply
although it is annoying when people assume i havent done my research before i post even though I have
The problem Ive got is that i have a hyperlinkfield which i cant put an onclick event into therefore it makes my original question a bit more tricky as where on earth do i put the javascript to set the new window to a certain size
thats the problem i have
|
|
|
|
|
a-+s-+p-+ wrote: i have a hyperlinkfield which i cant put an onclick event into
Have you tried some thing like
YourControlName.Attributes.Add("onclick",<br />
"window.open('page2.aspx','mywindow','status=1');"); ?
*jaans
|
|
|
|
|
yep because i have to sepcifit inside the gridview the exact column i.e. gridview.columns[1] it wont work
thanks anyway
|
|
|
|
|
|
Hi all
iam developing a search page where the user can enter and select from different dropdownlists to construct the select statement. The user can add several rows(search criteria). I want to maintain the criteria the users chooses, lets say he selects first criteria and second or third. To save the criteria i have inserted a grid and what i want is to insert to this grid as rows. Each time the user chooses criteria he presses Add and this criteria is saved temporarly in the grid so i can upon pressing search to collect all criteria in one big select statement and do the search. How can i insert/delete to this grid?
|
|
|
|
|
You can save a DataTable in viewstate. Add a new row to your Datatable and then rebind the grid.
I didn't get any requirements for the signature
|
|
|
|