|
Hai
Thanks...I am very new to .net..am using 2003 with .NET 1.1 (C# coding) From where we add pager template.By adding dropdown How datalsist shows the page number???
Bijesh
pain gives gain
|
|
|
|
|
I did the following to fill tha datagrid
1.Through the vb code ,dyanmically add the template column and bound column in my datagrid.
In that template column i add a link button .
2.In the page load call the function to fill the datagrid
3.In datagrid item command event i wrote the code for the link button to redirect to someother page.
4.It's working properly
5.Next I add a button in the page
6.In the button click event i wrote the code to delete the selected items in the grid.
7.It's not working
8. If i write the code in the page load like this,
If Not IsPostBack Then
FillDataGrid()
End If
the button event is working. But link button event is not working.
9..If i simply call the funtion FillDataGrid() in page load means Link button event is working,
but the button event is not working11:18
|
|
|
|
|
i have a problem
i have multiple web pages and when i move from one page to another though the control moves to the other page but when i user this.PreviousPage it gives null value
in some page there is no problm this.PreviousPage gives the previous page
thanx
|
|
|
|
|
are u specified the this in u r current page?
<%@ PreviousPageType VirtualPath="~/PreviousPage.aspx" %>
also u have specify for the button from where u r navigating. other it will gives null
<asp:Button ID="Button1" Runat="server" Text="Submit"<br />
PostBackUrl="NextPage.aspx" />
GV Ramana
|
|
|
|
|
Hi all,
I am using asp.net and C# Visual studio 2005.
Let me explain the scenario. I have stored procedure which return very no of column based on condition. Becoz I have to show columnwise record I used datalist.
And becoz of query return different no of column based on condtion I created template class for design and itembinding at run time .
I manage to create template column() but confuse over how to bind data. As no of column differ at runtime.
Code I used I am attaching it below . if you have better approach please tell me
Please guide me .
1 public class MyTemplate:ITemplate
2 {
3 ListItemType templateType;
4 String para1, para2, para3, para4, para5;
5
6
7 public MyTemplate(System.Web.UI.WebControls.ListItemType type,string parameter1)
8 {
9 templateType = type;
10 para1 = parameter1;
11 }
12
13 //
14 public void InstantiateIn(System.Web.UI.Control container )
15 {
16 PlaceHolder ph = new PlaceHolder();
17 ImageMap imp = new ImageMap();
18 //declaration
19 imp.ID = "img1";
20
21 switch (templateType)
22 {
23 case ListItemType.Header:
24 // ph.Controls.Add(new LiteralControl("<html> <body>"));
25 ph.Controls.Add(new LiteralControl("<table border=\"1\">" ));
26 break;
27 case ListItemType.Item:
28
29 ph.Controls.Add(new LiteralControl("<tr align = left><td align = left >"));
30 ph.Controls.Add(imp);
31 // some code
32 //optional parameter
33 if (!((para1 == "categoryid") || (para1 == "customerid") || (para1 == "retailprice") || (para1 == "subcategory")))
34 {
35 ph.Controls.Add(item5);
36 ph.Controls.Add(new LiteralControl("<br />"));
37
38 }
39
40 ph.Controls.Add(new LiteralControl("</td></tr>"));
41 ph.DataBinding += new EventHandler(Item_DataBinding);
42 break;
43
44 case ListItemType.Footer:
45 ph.Controls.Add(new LiteralControl("</table>"));
46
47 break;
48 }
49 container.Controls.Add(ph);
50 }
51
52
53 // container code end
54
55 static void Item_DataBinding(object sender, System.EventArgs e )
56 {
57 PlaceHolder ph = (PlaceHolder)sender;
58 DataListItem ri = (DataListItem)ph.NamingContainer;
59 //RepeaterItem ri = (RepeaterItem)ph.NamingContainer;
60 string impValue = (string)DataBinder.Eval(ri.DataItem, "photopath1");
61 // item1Value = (Int32)DataBinder.Eval(ri.DataItem, "CategoryID");
62 String item1Value = (String)DataBinder.Eval(ri.DataItem, "Categoryid1");
63 String item2Value = (String)DataBinder.Eval(ri.DataItem, "subcategoryid1");
64 String item3Value = (String)DataBinder.Eval(ri.DataItem, "customerid1");
65 String item4Value = (String ) DataBinder.Eval(ri.DataItem, "retailprice1").ToString() ;
66 ((ImageMap)ph.FindControl("img1")).ImageUrl = impValue;
67 ((Label)ph.FindControl("item1")).Text = item1Value.ToString();
68 ((Label)ph.FindControl("item2")).Text = item2Value.ToString();
69 ((Label)ph.FindControl("item3")).Text = item3Value.ToString();
70 ((Label)ph.FindControl("item4")).Text = item4Value;
71
72
73 }
74
75 }
76
77
}
thanks
imaran khan
|
|
|
|
|
I have a formview bound to a SqlDataSource which I use to insert a record to the database. for this newly inserted record, I want to generate a unique ID programmaticaly - (say ProjectID) and assign it to the formview control (PropertyIDLabel). a method createPropertyID() generates a PropertyID & returns it, but I don't know how I can set this value to the formview control. Can somebody help - immediately please???
|
|
|
|
|
Hi,
I m using javascript to make a textbox visible, which is set to style=display:none at the page load.But when i click the button (On which javascript is method is called), the textbox doesnot makes it visible.
I m doing
protected void Page_Load(object sender, EventArgs e)
{
string str = "function radio()" +
"{" +
"if(document.getElementById('radio1').Checked!=true)" +
"{" +
"document.getElementById('" + TextBox1.ClientID + "').visible;" +
"alert('sandeep');" +
"}" +
"}";
this.RegisterClientScriptBlock("clientScript", str);
Button1.Attributes.Add("onClick", "radio()");
}
Where i am going wrong...
Thanx
|
|
|
|
|
sandeep kumar pundhir wrote: "document.getElementById('" + TextBox1.ClientID + "').visible;" +
document.getElementById('" + TextBox1.ClientID + "').style.display = 'block';
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Thanx for ur reply.
But now wat is hapening.... The textbox1 becomes visible for a second after clicking the button, it again disappears
|
|
|
|
|
sandeep kumar pundhir wrote: The textbox1 becomes visible for a second after clicking the button, it again disappears
Oh. Yeah. It will happen like that.. So, you have to cache the status (whether this is currently visible or not.) then, you have to set it back on Page Load.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
"if(document.getElementById('radio1').Checked!=true)" +<br />
"{" +<br />
"document.getElementById('" + TextBox1.ClientID + "').style.display=block;" +<br />
<br />
"}" +<br />
"else"+<br />
"{"+<br />
"document.getElementById('" + TextBox1.ClientID + "').style.display=none;" +<br />
"}"+<br />
"return false;"
Best Regard
Pathan
-- modified at 1:00 Friday 31st August, 2007
---------------------------------------------------
|
|
|
|
|
I successfully created a child gridview with a datalist as my parent. It works well but i decided to put a total on the child gridview's footer. I use databoud fields instead of templatefield fo i can set the nulltext to "0". whn I click an item (item A) to my datalist(parent) it will show the gridview with total sum at the footer. The problem is that, when i click another item on the datalist (sample item B) the total sum at the childgrid of item B is correct but the total sum of the other childgridview (like item A) becomes "0". I used the RowDataBound event to get & compute the total using global variable. I used RowCreated to set the total at the footer.
Any help and sample codes would be appreciated. Thanks in advance.
|
|
|
|
|
hi friend's
i want to use parallel programming method for write my project.but i don't know how can i do it.
and i have one question about it:
is parallel programming similar to threading or not.
oh my god im confusing... please help me.
thank you
msma
|
|
|
|
|
|
Is it not possible to have the following in ASP.NET 2.0:
<br />
(something)<br />
<asp:LoginView><br />
<AnonymousTemplate><br />
<asp:Login ... /><br />
</AnonymousTemplate><br />
<LoggedInTemplate><br />
(something)<br />
</LoggedInTemplate><br />
</asp:LoginView><br />
...without having a separate page to login?
The idea is that I want to display a bunch of controls (that everybody can see), and then a section containing a login control (prompting for username/password) only if the user isn't currently logged in. If the user is logged in, then I want to display another set of controls (specified here within the LoggedInTemplate tag).
In other words, I don't want a separate page dedicated solely to the login process, but rather, have the login controls displayed "inline" (for lack of a better word) if the user isn't authenticated.
It seems that every form authentication sample I've come across so far implies that you have to have a separate login page that you'll get redirected to in order to perform the login process.
-- modified at 15:39 Thursday 30th August, 2007
|
|
|
|
|
Oh, the sheer stupidity.
I've just spent a day and a half on this.
Now I get an idea as I'm typing my message here, finish off my message, try out the idea, and sure enough, I've just found the solution.
The problem: my rules were setup so anonymous users were denied access to my page...and thus got redirected to login.aspx (which I haven't written) instead of getting prompted right there on that same page...
Lemme hear a big resounding DUH!
|
|
|
|
|
Okay, so here's a real question (jeez, I hate seeing 3 messages in a row in a thread all originating from myself...before anybody else has had a chance to write anything...)
I already had this page written and working before I tried adding the login control. Now I've moved the controls (that I only want authenticated users to see) within the <LoggedInTemplate> tag. Hit F5...and all references (in the code-behind) to those controls result in "The name 'xxx' does not exist in the current context".
For example, I have a listbox (lstCategories) within the <LoggedInTemplate> tag. It'll complain that this doesn't exist (anymore--it was working fine until I added the login stuff).
I've tried variations such as LoginView1.lstCategories, LoginView1.LoggedInTemplate.lstCategories, etc, but IntelliSense tells me none of that is valid.
It looks so far like my only option is to move everything I put in <LoggedInTemplate> outside of it, put that inside an <asp:Panel> instead, and set its visible state depending on whether HttpContext.Current.User.Identity.IsAuthenticated returns true or not.
Is this the best approach? The .aspx would be *so* much cleaner if I could leave those controls within <LoggedInTemplate>...not to mention having to manage visibility based on authentication state...
|
|
|
|
|
Hi guys i need to finish my project and i have no clue how do solve this issuse please help me i would realllly really appreciate. On my 2nd aspx page i want to get the myID value i am not getting anything.
<asp:linkbutton id="myLnkBtn" runat="server"
="" postbackurl="~/index.aspx?myId=<%=usrID%>">
|
|
|
|
|
it is an asp:LinkButton that has a property of PostabckURL
I am still unable to solve could some body please tell me
|
|
|
|
|
hello...
if it is LinkButton then use
Response.Redirect()/Server.Transfer() .... it is more ideal....
Try it........
|
|
|
|
|
follow steps
Step1 : Make public property of UsrId in first page
Step2 : Use PostBackUrl="~/index.aspx" Instead of PostBackUrl="~/index.aspx?myId=<%=usrID%>"
Step3 : Use PreviousPage Directory in Source html of second page
<%@ PreviousPageType VirtualPath="FisrtPageName.aspx" %>
Step4 : get UserId int UsrId=this.PreviousPage.PropertyName
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Thank you so much you have just solved one problem. Now the thing that confusing me is that for each linkbutton i want to associate a value.
Lets say there are 5 link button so how could I assigned a unique value with each linkbutton. That i need to do my calucation.
Any help would be appreciated
|
|
|
|
|
You can identify using LinkButton lnk = (LinkButton)sender;
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Hi All,
I have another question.
I have a table, and I want the user to be able to dynamically add multiple rows to this table. Then during the final submit, I want to get information from these dynamic rows.
However the table isn't passed to the code behind by either Request.Form or Request.Params. Do you know where I would get access to the table in the code behind?
- Munty
|
|
|
|
|
Muntyness wrote: Do you know where I would get access to the table in the code behind?
If your table is a server control you may get access from the code behind. Make your table as server control and access with it's id
|
|
|
|