|
although the text is too long.
but the key code only a bit.
please notice the key code.
test your vs2005 compile it.
my english is poor. sorry.
http://www.123de6.cn
|
|
|
|
|
help
http://www.123de6.cn
|
|
|
|
|
Hai,
How to add a selected listbox data into another listbox
|
|
|
|
|
In Listbox you are having a Items.Add method using which you can add the selected items of the previous listbox.
Apurva Kaushal
|
|
|
|
|
Thanks for your co-operation i got the solution already.Sorry for the trouble made to you people.
|
|
|
|
|
That's alright..
Apurva Kaushal
|
|
|
|
|
Hi,
I'm facing one of the issue discussed in this article. I've created a user control with a DataGrid on it. I've created properties to make this control visible, and to set the connection information for database.
I'm doing all these in the Page_Load event of that user control. In the main form where i'm using this control, I have a button that I use to make this control visible. During Page load of main page, I make the user control visible false, and only when the user clicks the button its made visible.
But the problem is that before the button click event of the main form, the page_load of the user control is getting fired (as discussed in ur article).. What can I do now?
Regards,
Blumen
|
|
|
|
|
This is not an article, it's a programming forum. Page load is called before events. Always. Put it in your prerender, if you want it to fire after the button click.
There's a forum in the article, if you want to ask an author something
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 )
|
|
|
|
|
Ok, I'll try it in Prerender event.
Sorry about the "article" reference in my message.
Regards,
Blumen
|
|
|
|
|
In my page there are two textboxes to enter dates. FromDate and ToDate textboxes. The difference between FromDate and ToDate should not be geater than 31 days. and also make sure FromDate should be less than ToDate. How to validate on client side. Am using asp.net 2.0 and c#.
Can anyone give solution?
Thanks in advance.
|
|
|
|
|
You can use calendar to avoid basic date validation. But if you are using simple text box to get the date then Here[^] you can get so much help.
Apurva Kaushal
|
|
|
|
|
Hello Guys.
This is just about my first post on here.
My problem on which i need some help on is as follows:
I have no problem invoking the edititemtemplate on a (Not nested) datalist.
But once i try invoking it on a nested datalist nothing happens, i have assured
that my edit button event fires. But the edititemtemplate never gets rendered.
Below you'll find a snippet of my aspx file:
<asp:DataList
ID="HeadlinesDataList"
runat="server"
OnItemDataBound="HeadlinesDataList_ItemDataBound"
DataKeyField="headlineID"
OnEditCommand="HeadlinesDataList_EditCommand"
OnCancelCommand="HeadlinesDataList_CancelCommand"
OnUpdateCommand="HeadlinesDataList_UpdateCommand">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "headlineName") %>
<asp:LinkButton ID="EditHeadlineButton" runat="server" CommandName="Edit">[Edit]</asp:LinkButton><br />
!--Categories-->
<asp:DataList
ID="CategoriesDataList"
runat="server"
DataKeyField="categoryID"
OnEditCommand="CategoriesDataList_EditCommand">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "CategoryName") %>
<asp:LinkButton ID="EditCategoryButton" runat="server" CommandName="Edit">[Edit]</asp:LinkButton><br />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="CategoryName" runat="server" Text='<%# DataBinder.Eval Container.DataItem, "categoryName") %>'></asp:TextBox>
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="Cancel">[Cancel]</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" CommandName="Update">[Update]</asp:LinkButton>
</EditItemTemplate>
</asp:DataList>
<!--/Categories-->
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="HeadLineName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "headlineName") %>'></asp:TextBox>
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="Cancel">[Cancel]</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" CommandName="Update">[Update]</asp:LinkButton>
</EditItemTemplate>
</asp:DataList>
<!--/Headlines-->
And here you'll see my code file for the aspx, My edit button on the nested datalist invokes this method:
CategoriesDataList_EditCommand
------------------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class showHeadlines : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
HeadLinesDatabind();
}
}
public void HeadLinesDatabind()
{
dbHeadlines myHeadlines = new dbHeadlines(ConfigurationManager.AppSettings.Get("ConnectionString"));
HeadlinesDataList.DataSource = myHeadlines.getheadlines(Request.QueryString.Get("structuretemplateid"));
HeadlinesDataList.DataBind();
}
public void CategoriesDatabind()
{
}
protected void HeadlinesDataList_ItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
dbCategories myCategories = new dbCategories( ConfigurationManager.AppSettings.Get("ConnectionString") );
System.Data.OleDb.OleDbDataReader myCategoriesReader = myCategories.getcategories(HeadlinesDataList.DataKeys[e.Item.ItemIndex].ToString());
((DataList)e.Item.FindControl("CategoriesDataList")).DataSource = myCategoriesReader;
((DataList)e.Item.FindControl("CategoriesDataList")).DataBind();
myCategoriesReader.Close();
}
}
protected void HeadlinesDataList_EditCommand(object source, DataListCommandEventArgs e)
{
//((DataList)source).EditItemIndex = e.Item.ItemIndex; // Works
HeadlinesDataList.EditItemIndex = e.Item.ItemIndex; // Works too
HeadLinesDatabind();
}
protected void CategoriesDataList_EditCommand(object source, DataListCommandEventArgs e)
{
// First attempt
DataList myCategoriesDatalist = (DataList)source; // Does not work
myCategoriesDatalist.EditItemIndex = e.Item.ItemIndex; // Does not work
// Second attempt
// ((DataList)source).EditItemIndex = e.Item.ItemIndex; // Does not work
// Third attempt
//((DataList)HeadlinesDataList.FindControl("CategoriesDataList")).EditItemIndex = e.Item.ItemIndex; // Does not work
HeadLinesDatabind();
}
protected void HeadlinesDataList_CancelCommand(object source, DataListCommandEventArgs e)
{
HeadlinesDataList.EditItemIndex = -1;
HeadLinesDatabind();
}
protected void HeadlinesDataList_UpdateCommand(object source, DataListCommandEventArgs e)
{
System.Web.UI.WebControls.TextBox HeadLineName = ((TextBox)e.Item.FindControl("HeadLineName"));
dbHeadlines myHeadlines = new dbHeadlines(ConfigurationManager.AppSettings.Get("ConnectionString"));
// myHeadlines.UpdateHeadlineName((int)HeadlinesDataList.DataKeys[e.Item.ItemIndex], ((TextBox)e.Item.FindControl("TextBox1")).Text);
myHeadlines.UpdateHeadlineName((int)HeadlinesDataList.DataKeys[e.Item.ItemIndex], HeadLineName.Text);
HeadLinesDatabind();
}
}
Okay i hope somebody can give me some help.. I'm just about to give up on this.
BTW: I'm coding in Visual Web Developer 2005 Express Edition.
Venlig hilsen / Regards
Steffen Otto Jensen
(Denmark)
|
|
|
|
|
Hi,
I need to call customized C# library serial on a local computer. How do i do it from asp.net pages? using C#.
I know how to call the dll if the dll is on the webserver. My dll access the usb device on the local pc.
Thanks
|
|
|
|
|
Nope. It is not possible to do that..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Hi,
ok here is the scenario:
I have two pages Transactions and Points. In the Transactions Page, I have an amount field. I was trying to pass on 10% of that amount to the Points page and directly set it in the Points Field.
I have tried several stuff. with some web help but it didn't work. I think what it is trying to do is open the page with a filter given the points= 10 example.
Please help
Thanks a lot
IssamK
|
|
|
|
|
how you are opening the Points page?
If you are opening it in a new window using javascript then you can pass it in querystring or you can access the field in transaction page using opener.document.getElementById(amountfield).
And if you are redirecting it from server side using response.redirect or server.transfer then you can keep it in session before redirecting and access it from session in Points page.
-----
|
|
|
|
|
|
Ok guys,
i am not very much aware of this code, i am just kinda debugging.
what is interesting to mention is this:
<smartone:themebutton runat="server" id="SaveButton" button-causesvalidation="True" button-commandname="UpdateData" <b="">Button-RedirectURL="Mypage.aspx?Points={TransactionRecordControl:FV:Amount}"
does it help?
thanks.
IssamK
|
|
|
|
|
here is the straight forward code.
in transaction.aspx add a button like:
<br />
<asp:button id="btn" runat="server" onclick="redirectToPoints" text="Open Points Page" /><br />
in code behind file for transaction.aspx.cs do this:
<br />
protected void redirectToPoints(object sender, EventArgs e)<br />
{<br />
Session["tranAmount"] = youramount;
Response.Redirect("points.aspx",true);<br />
}<br />
in PageLoad function in code behind file for points.aspx.cs do this:
<br />
protected void PageLoad(object sender, EventArgs e)<br />
{<br />
if(!IsPostBack)<br />
{<br />
textboxPoints.Text = Session["tranAmount"].ToString(); <br />
}<br />
}<br />
-----
|
|
|
|
|
hi friends,
am using one table,there is 3 field(name,address,father name) is having.but inserted totally 5 records.In all column data first character small letter.
example :(Database)
Name Address Father Name
raja salem rajasekar
laxman chennai anbuselvan
bala bangalore muthu
senthil covai durai
arun hosur ganesh
Note :
Am using front end repeater control.I want display all column data starting letter in capital letter.help me very urgent
I want display the front end form is example :
(FRONT END):
=============
Name Address Father Name
Raja Salem Rajasekar
Laxman Chennai Anbuselvan
Bala Bangalore Muthu
Senthil Covai Durai
Arun Hosur Ganesh
with Regards,
D.Thirumurugan.
|
|
|
|
|
I already respond your question dated November 16 check this[^]
-----
|
|
|
|
|
Don't cross post it makes you rather unpopular.
|
|
|
|
|
hi,
well what you could try and do is to use the charAt(0) functionality of each field. and set it to upper case.
am not a pro, however this is a primitive sample code for a form with two textboxes and a button.
Dim a As String
a = TextBox1.Text
Dim b As String
b = a.Chars(0)
b = b.ToUpper()
Dim c As String
c = b & a.Substring(1, a.Length() - 1)
TextBox2.Text = c
Good luck...
IssamK
|
|
|
|
|
I have been trying this for ages but it just doesn't seem to work. I have an image control inside a repeater control. the image control is bound to an image using the image url and databinding this when all information is called:
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<HeaderTemplate>
<h2><asp:Label ID="lbl_title" runat="server">T.R.E.E Team</asp:Label></h2>
</HeaderTemplate>
<ItemTemplate>
<div class="story">
<p>
<h1><asp:Label ID="lbl_Role" runat="server"><%#DataBinder.Eval(Container.DataItem, "Team_Role")%></asp:Label></h1><br />
<asp:Image ID="image_role" ImageUrl="%#DataBinder.Eval(Container.DataItem, "Team_Name")%" runat="server" />
<asp:Label ID="lbl_Name" runat="server"><%#DataBinder.Eval(Container.DataItem, "Team_Name")%></asp:Label><br />
<asp:Label ID="lbl_Description" runat="server"><%#DataBinder.Eval(Container.DataItem, "Team_Description")%></asp:Label><br />
<asp:Label ID="lbl_Telephone" runat="server"><%#DataBinder.Eval(Container.DataItem, "Team_Telephone")%></asp:Label><br />
<asp:Label ID="lbl_Email" runat="server"><%#DataBinder.Eval(Container.DataItem, "Team_Email")%></asp:Label><br />
</p>
</div>
</ItemTemplate>
</asp:Repeater>
I am using the new visual web developer 2008. If anyone knows why this is not working please let me know.
|
|
|
|
|
you have this line:
<asp:Image ID="image_role" ImageUrl="%#DataBinder.Eval(Container.DataItem, "Team_Name")%" runat="server" />
change it with this one and it should work:
<asp:Image ID="image_role" ImageUrl='<%#DataBinder.Eval(Container.DataItem, "Team_Name")%>' runat="server" />
you were using % instead of <% and " instead of '
-----
|
|
|
|