|
Christian Graus wrote: But he said he doesn't bind to it at all.....
No.He said he loses selected value on postback.
please don't forget to vote on the post that helped you.
|
|
|
|
|
I have noticed that it just not losing the selected value but also writing a blank text. the Viewstates are now enabled and still no change
|
|
|
|
|
Can you post your code, it might help us re-create your problem
|
|
|
|
|
here is my page load module;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
lngSiteID = Convert.ToInt64(Request.QueryString["ID"]);
LoadSiteDetail(lngSiteID);
//loadSiteTreeView();
Session["AddNewRecord"] = "false";
tvwSites.CollapseAllNodes();
tboSiteID.Text = Convert.ToString(lngSiteID);
LoadCombos();
MainContactLoad(lngSiteID);
//LoadData();
}
else
{
lngSiteID = Convert.ToInt64(Request.QueryString["ID"]);
//tboLocation.Text = (string)Session["LocName"];
//LoadSiteDetail(lngSiteID);
//MainContactLoad(lngSiteID);
cboContact.DataBind();
}
}
|
|
|
|
|
here is my page load module;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
lngSiteID = Convert.ToInt64(Request.QueryString["ID"]);
LoadSiteDetail(lngSiteID);
//loadSiteTreeView();
Session["AddNewRecord"] = "false";
tboSiteID.Text = Convert.ToString(lngSiteID);
LoadCombos();
MainContactLoad(lngSiteID);
//LoadData();
}
else
{
lngSiteID = Convert.ToInt64(Request.QueryString["ID"]);
cboContact.DataBind();
}
}
|
|
|
|
|
Hie all, did anyone manage to figure out what is causing the combos on my forms to lose values.
Thank you
|
|
|
|
|
hai all,
i am using .net 2005.i do my project in asp.net.
i am doing master log attendace.the field names are name,fromdate,todate.
i keep tools are namedropdownlist,fromdateTextbox,todatetextbox,2 calendars and submit button.
ex-1
If i select name 'arun' from namedropdownlist,then i click june 1 2008 in first calendar,then displayed as '06/01/2008' in from date textbox.Then i click june 4 2008 in second calendar,then displayed as '06/04/2008' in todatetextbox.Then i click submit button means,the following output is display,
Name ----- 6/1/2008 --- 6/2/2008 --- 6/3/2008 --- 6/4/2008
Arun ---------- x
Arun ------------------------- x
Arun ---------------------------------------- x
Arun -------------------------------------------------------- x
in above there are 4 lines.
But i want following output in single line
Name 6/1/2008 6/2/2008 6/3/2008 6/4/2008
Arun --------- x --------- x ---------- x ---------- x
note: x is present,dash(-) indicate space.
here name is field.the above 4 date are where i selected from date as june 1 and todate as june 4.
ex-2
If i select 'All Details' from namedropdownlist,then i click june 6 2008 in first calendar,then displayed as '06/06/2008' in from date textbox.Then i click june 9 2008 in second calendar,then displayed as '06/09/2008' in todatetextbox.Then i click submit button means,the following output is display,
Name ---- 6/6/2008 --- 6/7/2008 --- 6/8/2008 --- 6/9/2008
Arun --------- x
Arun ------------------------ x
Arun --------------------------------------- x
Arun ------------------------------------------------------- x
Bala ---------- x
Bala ------------------------ x
Kumar -------- x
Kumar ------------------------------------------------------ x
But i want following output
Name ---- 6/6/2008 --- 6/7/2008 --- 6/8/2008 --- 6/9/2008
Arun --------- x ------------ x ------------ x ------------ x
Bala --------- x ------------ x
Kumar ------ x ------------------------------------------ x
note: x is present,dash(-) indicate space,empty space is absent.
here name is field.the above 4 date are where i selected from date as june 6 and todate as june 9.
the following codes are,
protected void img_submit_Click(object sender, ImageClickEventArgs e)
{
from_date = txt_fr_date.Text;
to_date = txt_to_date.Text;
emp_name = ddl_emp_name.SelectedValue;
check();
}
void check()
{
System.TimeSpan dt_diff = Convert.ToDateTime(to_date).Subtract(Convert.ToDateTime(from_date));
days = dt_diff.Days;
for (int i = 0; i <= days; i++)
{
sql_date = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
sql_date1 = Convert.ToDateTime(from_date).AddDays(i).ToString("MM/dd/yyyy");
dt.Columns.Add(new DataColumn(sql_date1, typeof(string)));
drow = dt.NewRow();
com = new SqlCommand("select * from tbl_report where emp_id='366' and datetime1='" + sql_date + "'", con);
dr = com.ExecuteReader();
while (dr.Read())
{
drow = "x";
dt.Rows.Add(drow);
}
dr.Close();
}
GV_musterrole.DataSource = new DataView(dt);
GV_musterrole.DataBind();
}
|
|
|
|
|
This code will blow up for all sorts of reasons. What if a non valid date is entered ?
What you want to do, should be done in the DB, it's called a pivot table.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
hello friends,
i am using excel report in asp.net. my excel report is working fine when run within cs file. when publish the project to run on iis the show error. object refrance not set.
|
|
|
|
|
That means something you assumed would never be null, is null. Perhaps because Excel is not on the server ? I am obviously guessing, no-one could actually pinpoint the error without seeing the code that is throwing the exception.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Server Error in '/WebSetup4' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
Anyone having any idea ???
|
|
|
|
|
As the error messsage is saying there is error in the application
to see the specific error make the custom Error mode off in web.config
<customErrors mode="Off"/>
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hello all,
I am having one difficulty. I am developing a website. On my home page i am having some article and in need that these article should move contentiously in a div tag (like marquee tag moves but marquee tag move horizontally i need it to be move vertically) and on mouse over of any link they should stop moving. How should i implement this. Please guide me.
Thanks
Rahul
SOLVED
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
modified on Monday, August 11, 2008 7:56 AM
|
|
|
|
|
You should write a javascript function which will control the scrolling of the content
|
|
|
|
|
Hi Manas,
Can u provide me any sample code?
Thanks
Rahul
SOLVED
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
modified on Monday, August 11, 2008 7:56 AM
|
|
|
|
|
From the documentation of the SmtpClient class:
If there is an e-mail transmission in progress and you call SendAsync or Send again, you will receive an InvalidOperationException.
Does that mean users can't send mail (from different threads) at the same time?
Also is there any way to get notified 'programmatically' when the mail is delivered?
Thanks
|
|
|
|
|
Waleed Eissa wrote: Also is there any way to get notified 'programmatically' when the mail is delivered?
SendAsyc has an event that fires when it has sent. It's not very reliable, you can't know it was delivered, only that it was sent.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Thanks a lot for your reply, actually I know about this event but I was hoping there's a more reliable way, basically what I'm trying to do is automate the whole process, this is why I don't want to use DeliveryOptions because I don't want to keep checking my email every now and then to make sure every message was sent, doesn't seem a very reliable way in a production environment. It seems that there's no way to communicate with the SMTP server, I wonder how all those websites with high traffic handle mail issues ..
|
|
|
|
|
No, there is literally no way to know if a mail got sent correctly, your best bet is to write a program that checks mail on the return address to see if you get a failure notice, but even that won't really work.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi
I have used the following tutorial to create an autocomplete extender.
The problem is, it is not working. When I type text in the box nothing happens.
Is there something missing from the exampl code I have used.
I'm not sure where the string value gets filled which is shown in the tuturial.
Any help would be great
thanks!
http://www.aspdotnetcodes.com/AutoComplete_From_Database.aspx
|
|
|
|
|
I think problem is in webservice.I had case like you and when I added third line (of lines down below) it worked.
Try this:
[WebService(Namespace = "http://tempuri.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[System.Web.Script.Services.ScriptService]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Thanks for the reply, but that didnt work.
Below is my code for extender control
<asp:textbox id="tb_description" runat="server" xmlns:asp="#unknown">
<atlas:autocompleteextender id="AutoCompleteExtender1" minimumprefixlength="1" runat="server" xmlns:atlas="#unknown">
<atlas:autocompleteproperties targetcontrolid="tb_description" servicemethod="GetactdescInfo" servicepath="~/autocomplete.asmx" enabled="True">
Is there anything wrong with that?
|
|
|
|
|
this work for me and I am using in VS.NET 2005
<asp:ScriptManager id="ScriptManager1" runat="server"><br />
</asp:ScriptManager><br />
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtTo"<br />
ServicePath="WebService.asmx" Enabled="true" MinimumPrefixLength="1" ServiceMethod="MethodNameFromWebService"><br />
</cc1:AutoCompleteExtender>
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
OK, well there must be a problem with the web service then
The code is displayed below.When I type text in the box nothing appears
thanks
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class autocomplete : System.Web.Services.WebService {
[WebMethod(EnableSession = true)]
public string[] GetactdescInfo(string prefixText)
{
int count = 10;
string project = HttpContext.Current.Session["project"].ToString();
SqlConnection connectionString = new SqlConnection(ConfigurationManager.ConnectionStrings[project].ConnectionString);
connectionString.Open();
string sql = " SELECT description" +
" FROM act" +
" WHERE description like '" + prefixText + "' ";
//string description_condition = " AND description LIKE '%" + prefixText + "%'";
//sql += description_condition;
SqlDataAdapter dataAdapter1 = new SqlDataAdapter(sql, connectionString);
dataAdapter1.SelectCommand.Parameters.Add("@prefixText", SqlDbType.NVarChar, 2000).Value = prefixText + "%";
DataTable datatable1 = new DataTable();
dataAdapter1.Fill(datatable1);
string[] items = new string[datatable1.Rows.Count];
int i = 0;
foreach (DataRow datarow in datatable1.Rows)
{
items.SetValue(datarow["description"].ToString(), i);
i++;
}
return items;
}
}
|
|
|
|
|
.netman wrote: " WHERE description like '" + prefixText + "' ";
try to add precentage sign:
" WHERE description like '" + prefixText + "%' "
My webservice which works:
<%@ WebService Language="C#" Class="WebService" %><br />
<br />
using System;<br />
using System.Web;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
<br />
[WebService(Namespace = "http://tempuri.org/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[System.Web.Script.Services.ScriptService] <br />
<br />
public class WebService : System.Web.Services.WebService {<br />
<br />
[WebMethod]<br />
public string[] GetUserName(string prefixText)<br />
{<br />
<br />
System.Data.DataSet dtst = new System.Data.DataSet();<br />
<br />
System.Data.SqlClient.SqlConnection sqlCon = new System.Data.SqlClient.SqlConnection("Data Source=.;Initial Catalog=BussinesTube;Integrated Security=True");<br />
<br />
string strSql = "SELECT name+' ' +lastname +' ; < '+ username + ' > 'as [name] from users WHERE [name] LIKE '%" + prefixText + "%' ";<br />
<br />
System.Data.SqlClient.SqlCommand sqlComd = new System.Data.SqlClient.SqlCommand(strSql, sqlCon);<br />
<br />
sqlCon.Open();<br />
<br />
System.Data.SqlClient.SqlDataAdapter sqlAdpt = new System.Data.SqlClient.SqlDataAdapter();<br />
<br />
sqlAdpt.SelectCommand = sqlComd;<br />
<br />
sqlAdpt.Fill(dtst);<br />
<br />
string[] cntName = new string[dtst.Tables[0].Rows.Count];<br />
<br />
int i = 0;<br />
<br />
try<br />
{<br />
<br />
foreach (System.Data.DataRow rdr in dtst.Tables[0].Rows)<br />
{<br />
<br />
cntName.SetValue(rdr["Name"].ToString(), i);<br />
<br />
i++;<br />
<br />
}<br />
<br />
}<br />
<br />
catch { }<br />
<br />
finally<br />
{<br />
<br />
sqlCon.Close();<br />
<br />
}<br />
<br />
return cntName;<br />
<br />
}<br />
<br />
<br />
<br />
}
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|