|
|
Hi all
Just wondering if anyone can help me. What I am looking to do is create a control that functions similar to the latest outlook email panel. You know the middle pane on the default view that allows you select the email to look at.
So I am looking for a method of splitting/grouping rows that are being fetched from a view into a repeater dependant on a date value. I assume for this that I will have to use a nested repeater, no probs with that, but what I would also like is to be able to do is collapse each section of the view for a particular day to hide it, like outlook does. I am assuming that I could use that Ajax toolkit collapsible panel for this? But not sure if that will work around sections of a repeater? I Guess I am looking for advice as to whether this is possible and the best method for a solution. I don’t need the code…I can figure that bit out, more concerned with the actual technicalities of it actually being possible and how to do it. If indeed it is at all possible and I ain’t just wasting my time!
All help most appreciated.
Cheers
Ian
|
|
|
|
|
Hi i am trying to display my grid cell value in grid textbox...,
So i used this following code...,
For Each fillgrdregtextbox As DataGridItem In dgrdmain1.Items
Dim AppRgHrs As TextBox = CType(fillgrdregtextbox.FindControl("txtAppRgHrs"), TextBox)
Dim AppOtHrs As TextBox = CType(fillgrdregtextbox.FindControl("txtAppOtHrs"), TextBox)
If fillgrdregtextbox.Cells(25).Text <> "" Then
AppRgHrs.Text = Val(fillgrdregtextbox.Cells(25).Text)
AppOtHrs.Text = Val(fillgrdregtextbox.Cells(26).Text)
ElseIf fillgrdregtextbox.Cells(27).Text <> "" Then
AppRgHrs.Text = Val(fillgrdregtextbox.Cells(27).Text)
AppOtHrs.Text = Val(fillgrdregtextbox.Cells(28).Text)
Else
AppRgHrs.Text = 0
AppOtHrs.Text = 0
End If
Next
In this that first if condition is working...,
But that elseif is not working...,(Mentioned in bold)
Instead of that i am getting 0 on there...,
how to solve it...,
Plz tell me...,
Advance thanks...,
Regards,
Magi
|
|
|
|
|
I would suggest using findcontrol instead of using Cells(27) directly. As far as your code you should not have an elseif It should just be an if.
Ben
|
|
|
|
|
kubben wrote: you should not have an elseif It should just be an if.
There's nothing wrong with ElseIf
|
|
|
|
|
Why do you say that? He isn't looping through the cells. The first if will always hit and the elseif won't. I don't know for sure that is his problem, but it seems likely from looking at the code.
Ben
|
|
|
|
|
Sorry, I thought you were querying his syntax...
But why should the first If always hit? It may be the cell's value is blank...
|
|
|
|
|
Ok so the elseif will hit every once in a while if the first one is blank. You still don't want an elseif there.
Ben
|
|
|
|
|
He obviously does! IF there is a value in cell 25 use that and cell 26, elseif there is a value in 27 use that and cell 28, else leave blank.
|
|
|
|
|
Magh_M wrote: Instead of that i am getting 0 on there
Do you mean 0, or nothing?
Why the Val() functions, and why
Magh_M wrote: AppRgHrs.Text = 0
AppOtHrs.Text = 0
When you need to put a string into a textbox, not a number...
Where is this code - what function of your code-behind? Are you trying to insert these values in Edit rows? Post the whole function...
|
|
|
|
|
Hi all
I want to know How can we define no of rows in a window.
but this script writes all rows of that gridView.
So How can we control no of rows so we can print as many no of record as we want. Is there any other function Please let me know.
Your help is highly appreciated, Thanks
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var strOldOne=prtContent.innerHTML;
var WinPrint = Window.open('','','letf=100,top=100,width=1000,height=1000,toolbar=0,scrollbars=1,status=0,resizable=1');
WinPrint.document.write(prtContent.outerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Hi
I responded to a post today regarding built in datasource vs custom data access objects.
After replying I began to think about these and quickly came to the realisation that I know jack all to be fair.
Obviously I shall be reading around on msdn etc but I would just like some opinions. My question is this.
How good is the datasource object regards efficiency, error handling, working under load etc.
The obvious advantage is speed of development but what are its major disadvantages?
I understand this is a very wide topic so just pointers and opinions would be great.
Thanks
Dan
|
|
|
|
|
Hi! The following problem is giving me headache now for a few days. I`m writing a aspx Webpage with C# code-behid.
In the Default.aspx Page I have a literal container which loads HTMLPages from a certain folder.
(I call //host/Default.aspx?/folderpath/filneame.htm, check for the path behind the ? char and call the HTML Page with StreamReader. Finally it is added to the litcontrol) This works fine, the only problem is, that everybody can access the file directly by inserting the path in the browser. I tried it with a web.config file which denied access for non authorized users, even denied the GET Method, but still no success.
Does anybody know how to do this? I mean the files of this certain folder should just be allowed to called if you are authorized by my Database. A direct access should be denied.
Help would be appreciated
|
|
|
|
|
ezazazel wrote: the only problem is, that everybody can access the file directly by inserting the path in the browser
Only if they know the filename... you could give it, or append to it's name before saving, a randomly generated string (say 6 chars min) and it'll be all but impossible that anyone will ever manage to browse to it. If the file/s change/s, you could store the filename/s in the db (or an xml file) and recall as needed...
For that matter, of course, you could just store the file contents in the db to begin with.
Yes, no doubt the Authentication classes can solve this problem more elegantly, but as you say.... you need some headache tablets handy... I must say, I've never managed to get my head around them....
|
|
|
|
|
Hi.am doing one music.in this site am keeping all the songs in the webserver.so while opening the songs page user can select all songs or some songs for play.after selecting the songs am adding the selected songs into play list.so my question is where i can keep this play list.when i tried to add this playlist into client machine getting access denied error.suppose if am storing that playlist in the server it will take time to play all the songs from the playlist,and also if am keeping in the server so many files will come in the server and size also increase.so what is the solution for playing the selected songs very fastly.somebody can get me some idea.
|
|
|
|
|
You will have to keep it on the server, obviously.
Kurian_Kurian wrote: suppose if am storing that playlist in the server it will take time to play all the songs from the playlist
How so ? The *songs* are on the webserver, but you think keeping a list of their names on the web server is going to be a speed issue ?
Kurian_Kurian wrote: so what is the solution for playing the selected songs very fastly
Can't you just serve them in order ? How do you play them ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have 2 RadioButtons in my page, and I have to change the visibility of 2 Asp Panels depending on which RadioButton is clicked. I use this JavaScript function for this:
function ToggleRbn1(p)
{ //alert(p.id);
if(document.getElementById(p.id).checked == true)
{
var id1 = document.getElementById('<%=pnlType1.ClientID%>');
var id2 = document.getElementById('<%=pnlType2.ClientID%>');
//alert(id2.innerHTML);
id2.style.display = "none";
id1.style.display = "block";
}
}
function ToggleRbn2(p)
{ //alert(p.id);
if(document.getElementById(p.id).checked == true)
{
var id1 = document.getElementById('<%=pnlType1.ClientID%>');
var id2 = document.getElementById('<%=pnlType2.ClientID%>');
id2.style.display = "block";
id1.style.display = "none";
}
}
I initially set Panel2 as invisible, but id2 would give error that time. If I keep it visible=true, then there is no problem. But that is not the requirement, Panel2 should be invisible at Page_Load, it should be visible only when user clicks RadioButton2. Error is: "Object Required".
Regards,
Blumen
|
|
|
|
|
|
Hi Ben,
I have put alert for parameter 'p', and value was correct. Anyways thanks alot for that article of yours, let me check that out and i'll get back to you.
Regards,
Blumen
|
|
|
|
|
hi All!
in mu asp.net web application, some pages are anonymously accessible, some pages required authentication & some pages required authentication + SSL .
i want to apply form authentication. how can i achieve this?
Thanks & Regards,
SAMir Nigam,
Software Engineer,
STPL, Lucknow, India.
|
|
|
|
|
I created my web controls dynamically then add them into panel control.
example:
TextBox txt=new TextBox();
txt.ID="test";
Panel1.Controls.Add(txt);
...well,controls will be displayed correctly but when I postback the page by using button or else ,the data entered on TextBox control will disappear.
My friends ,how can I solve this problem?
hi all frieds!!
piece in home,piece in world!
|
|
|
|
|
Your controls need to be added before the page load event, otherwise they don't exist when the viewstate tree is recreated, so the values are lost.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
well done...I tried Page_Init event..it creates Label control without causing any exception..but when I added my textbox type control to page it throws an exception that "the TextBox type control must be in form runat=server tag"..
please any suggestion?
hi all frieds!!
piece in home,piece in world!
|
|
|
|
|
Hi,
I would like to know how I can add a headerRow to a gridview, before I show it on the page. I will never know how many columns there will be(get amount of columns from another source), so I have to loop through an array each time, check how many columms there are, and then create a column(with text name) for each of the array items.
How will I add code to the following code, to add a header row?
<br />
'dtInvoice = datatable 'gdvInvoice = gridview<br />
gdvInvoice.DataSource = dtInvoice<br />
gdvInvoice.EmptyDataText = "No Data to Display"<br />
gdvInvoice.PagerSettings.Position = PagerPosition.Top<br />
gdvInvoice.AllowSorting = True<br />
<br />
Dim keyArray() As String = {ViewState("AppPrimaryKey")}<br />
gdvInvoice.DataKeyNames = keyArray<br />
<br />
gdvInvoice.DataBind()<br />
gdvInvoice.Visible = True<br />
|
|
|
|
|
i want to retrieve primary key of parent table and then send this key to child table,as they have one-one relationship
i've written code
string id = "SELECT MAX(c_id) FROM call_history";
SqlCommand com1 = new SqlCommand(id, conn);
SqlDataReader dr = com1.ExecuteReader();
if (dr.Read())
{
int i = Convert.ToInt32(dr.GetValue(1));
}
strQuery1 = "INSERT INTO call_log(c_id,c_add)VALUES("+ i +",'"+textBox2.Text +"')";
SqlCommand commm = new SqlCommand(strQuery1, conn);
commm.ExecuteNonQuery();
but it is goiving an error on insert atement that
"Use of unassigned local variable 'i' "
$h@ma!|@
|
|
|
|