|
Yes, sometimes its creates pain and very difficult to find out too.
Thanks !
Cheers !
Abhijit
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi all,
I am looking for an e-learning platform (opensource)in asp.net where I can develop the e-learning applications with scorm compatibility.
Any idea about it,
thanks in advance
|
|
|
|
|
|
I am using asp.net 2.0 and ajaxPro in my web application.
1. How can bind my dropdown inside ajaxPro method, without using HtmlTextWriter?
Is it possible?
All the server controls are null inside the ajaxPro method.
2. So, i have created dynamic server controls inside the ajaxPro method and used HtmlTextWriter and rendered in javascript. Here in javascript, i can't able to get this dynamic controls by using getElementId method.
document.getElementId(asp.net control id + "ControlId");
but it returns null.
thanx in advance!
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
jeneesh k. wrote: How can bind my dropdown inside ajaxPro method
You can't, databinding is done during page rendering by the ASP.NET engine.
jeneesh k. wrote: All the server controls are null inside the ajaxPro method.
Of course they are. You need to understand the page lifecycle and ajax calls.
Basically, you seem to have no clue about what Ajax is and how to use it. Please do us all, including yourself, a favor and research and understand the technology before trying to use it.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi, I have to make server calls from client side by taking the value from first combo need to populate the second one. dont use selected change event.
How it is possible????
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
I would recommend moving to ASP.NET AJAX which is built into
Visual Studio 2008 and available as additional feature pack for
Visual Studio .NET 2005. It provdes an update panel which can
bind your controls during an ajax call, here is a simple example ...
<%@ Page Language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList1.Items.Clear();
String[] ds = {"hi","sup"};
DropDownList1.DataSource = ds;
DropDownList1.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<style type="text/css">
#UpdatePanel1 {
width:300px; height:100px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="padding-top: 10px">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
</div>
</form>
</body>
</html>
|
|
|
|
|
Hi, i know update panel. I have to make server calls from client side by taking the value from first combo need to populate the second one. dont use selected change event.
How it is possible????
Thanks & Regards,
Jeneesh K. Velayudhan
|
|
|
|
|
<%@ Page Language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList1.Items.Clear();
String[] ds = {"hi RED","sup RED"};
String[] ds1 = { "hi BLUE", "sup BLUE" };
if (DropDownList2.SelectedValue == "RED")
{
DropDownList1.DataSource = ds;
DropDownList1.DataBind();
}
if (DropDownList2.SelectedValue == "BLUE")
{
DropDownList1.DataSource = ds1;
DropDownList1.DataBind();
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
<style type="text/css">
#UpdatePanel1 { width:300px; height:100px; } </style>
</head>
<body>
<form id="form1" runat="server">
<div style="padding-top: 10px">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem>RED</asp:ListItem>
<asp:ListItem>BLUE</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
</div>
</form>
</body>
</html>
|
|
|
|
|
Hi
update panel not working in asp.net 3.5 as it was working in asp.net 2.0.
may be because of I'm not able to make setting for httpHandlers and httpModules in web config in asp.net 3.5.
regards
Hari
You get the best out of others when you give the best of yourself.
|
|
|
|
|
What are you talking about? Why can't you make changes to the web.config? It appears you have other problems with your application/environment.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
when I put setting on web config:
<system.webServer>
<handlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</handlers>
<modules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
</system.webServer>
eroor:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
You get the best out of others when you give the best of yourself.
|
|
|
|
|
These are not correct for 3.5 project so of course it isn't working.
Version=1.0.61025.0 = ASP.NET 2.0
Version=3.5.0.0 = ASP.NET 3.5
I would suggest you create a new 3.5 project and compare the web.config files
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Dear All,
I am doing a scienero where I have dropdownList which is binded to datasource.
I want that based on selectedIndex it should do postback only once.
as for example
If the new SelectedIndex is 1 then it sould do a postback retreive all data from datasource based on selectedIndex. for the 2nd time If I select index 1 then It should not do postback but I want to store items in client side as the first index is selected at some var. and then every time new index is selected it should do postback then save binded items at some var.
any ideas?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
tgis is very simple.Did you try something?
Dropdown's selectedindexchanged event is called only you one change the index if selects the same again and again then it is not callled and there is no postback occurs in this scenario.
|
|
|
|
|
thanks for the reply, In fact you are true, but what happens when you first select Index 1 then index 2 then again index 1, I am sure I will do a postback which I dont wanted to do. I would like to store it at some client side variable. any ideas?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
When changing the selected Index, fire a javascript function which check whether the selected index is in the list of values stored in hidden variables if it is return false from the Javascript Method.
|
|
|
|
|
Hi,
in my string array,i am getting some values like this
str[0]="sree"
str[1]="jith"
str[2]="addr"
str[3]="pin"
str[4]=""
str[5]="abc"
str[6]="ghghj"
str[7]="ytu"
str[8]="ytuyi"
.
.
.
str[80]="hjk"
i ve to retriev data from this string according to the empty string and assign to a gridview row.
ie when count is on ""
i ve to assign it to corresponding textbox in gridview .
ie bind name as sree in textbox.
Any Idea?
Known is a drop, unknown is an ocean
|
|
|
|
|
Your question is not clear.
But as I understood, if you want to do some modification in displaying the data in gridview, hen you can do it in GridView.RowDataBound event.
For details of this event have a look
|
|
|
|
|
No, My question is how can we get that data from string array.
i ll explain it briefly.
there is a multiline textbox where user can copypaste some data like this
Sreejith
604 E 25th St
Chennaie, WY 82001-3133
Phone: (45) 67-64456
Rajesh
1609 E 19th St
Chennaie, WY 82001-4990
Phone: (453) 564-95654
Ramesh
1002 Rumsey Ave
Codys, WY 82414-3533
Phone: (307) 587-3008
this details may vary according to user input.
i am assigning this values in a string array.
string[] strData = strPasteData.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
while running if i insert a breakpint here and checking for data i am vieing data like this
str[0]="Sreejith"
str[1]="604 E 25th St"
str[2]="Cheyenne, WY 82001-3133"
str[3]="Phone: (45) 67-64456"
str[4]=""
str[5]="Rajesh"
str[6]="1609 E 19th St"
str[7]="Chennaie, WY 82001-4990"
str[8]="Phone: (453) 564-95654"
str[9]=""
str[10]="Ramesh"
str[11]="1002 Rumsey Ave"
.
.
.
.
but my question is how can we this dynamic data into into gridview
ie in my gridviw there are 4 columns
Name
Address
Address2
Phone
I ve to assign values from string array to corresponding fields
In first row i need
Sreejith,604 E 25th St,Chennaie, WY 82001-3133,Phone: (45) 67-64456
2nd row
Rajesh,1609 E 19th St,Chennaie, WY 82001-4990,Phone: (453) 564-95654
this is my requirement
Known is a drop, unknown is an ocean
|
|
|
|
|
You can not directly bind it in gridview in this form.As Abhijit suggested, create a datatable with your column names and add all the records as seperate rows like for
Sreejith
604 E 25th St
Chennaie, WY 82001-3133
Phone: (45) 67-64456
DataRow dr = dt.NewRow();
dr["Name"] = "Sreejith";
dr["Address1"] = "604 E 25th St";
dr["Address2"] = "Chennaie, WY 82001-3133";
dr["Phone"] = "Phone: (45) 67-6445";
dt.Rows.Add(dr);
dt.AcceptChanges();
Hope it'll help
|
|
|
|
|
Hi,
That I know.I think still you are not clear about my question,
u r telling to do it as static.But my qn is how to do it dynamic?
ie instead of
DataRow dr = dt.NewRow();
dr["Name"] = "Sreejith";
dr["Address1"] = "604 E 25th St";
dr["Address2"] = "Chennaie, WY 82001-3133";
dr["Phone"] = "Phone: (45) 67-6445";
dt.Rows.Add(dr)
dt.AcceptChanges();
i need to get all data from that string array.
DataRow dr = dt.NewRow();
string[] strData = strPasteData.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
dr{"Name"]=strData[i].ToString();
dr["Address1"]=strData[i].ToString();
dr["Address2"] =strData[i].ToString();
dr["Phone"]=strData[i].ToString();
Sreejith604
E 25th StChennaie,
WY 82001-3133
Phone: (45) 67-64456
consider the above data as 1 single record
but the problem is user will paste about 10 record at a time in a multiline textbox.
Here "" is the delimiter.if user entered 10 record there will be 9 ("")empty string to separate different data.
Known is a drop, unknown is an ocean
|
|
|
|
|
so similarly you can add the rows in table dynamically,If you user pastes 10 or record, as you are readin string ,have a loop of he no of recods that user pasted and add the row dynamically based on the entered text.and at last bind it to the gridview.
Might be i cannot understand your proble, but if you know yje delimiters then you can create dynamic datatable as well.
|
|
|
|
|
Try to use DataTable and DataRow and then assign the DataTable to GridView Source.
DataTable dt = new DataTable("Table1");
dt.Columns.Add("Name");
dt.Columns.Add("Address1");
dt.Columns.Add("Address2");
dt.Columns.Add("Phone");
DataRow dr = dt.NewRow();
Now add value for dr["Name"], dr["Address1"] ..... Finally Do the AcceptChange for Data Row. Create New Row for new records ( In your case it is "") and finally Assign the Data Table to GridView.
|
|
|
|
|
Hi,
That I know.I think still you are not clear about my question,
u r telling to do it as static.But my qn is how to do it dynamic?
ie instead of
DataRow dr = dt.NewRow();
dr["Name"] = "Sreejith";
dr["Address1"] = "604 E 25th St";
dr["Address2"] = "Chennaie, WY 82001-3133";
dr["Phone"] = "Phone: (45) 67-6445";
dt.Rows.Add(dr)
dt.AcceptChanges();
i need to get all data from that string array.
DataRow dr = dt.NewRow();
string[] strData = strPasteData.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
dr{"Name"]=strData[i].ToString();
dr["Address1"]=strData[i].ToString();
dr["Address2"] =strData[i].ToString();
dr["Phone"]=strData[i].ToString();
Sreejith604
E 25th StChennaie,
WY 82001-3133
Phone: (45) 67-64456
consider the above data as 1 single record
but the problem is user will paste about 10 record at a time in a multiline textbox.
Here "" is the delimiter.if user entered 10 record there will be 9 ("")empty string to separate different data.
IT IS LITTLE BIT COMPLICATED SO IT TAKES SOME TIME TO UNDERSTAND REQUIREMENT
Known is a drop, unknown is an ocean
|
|
|
|