|
I have no idea, I'd never use that nasty 'set a data source in the presentation layer' stuff that MS has built in to ASP.NET in recent times.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Ok, if i set my datasource in the c# instead like:
SqlDataSource1.SelectCommand = "select field from table"
how do I reference a field from that?
|
|
|
|
|
I believe you set the DisplayMember property to the name of the column you want to show.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi
sqldatasource does not have that attribute.
thanks anyway I will try the web.
cheers
|
|
|
|
|
No, the drop down list does.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Imagine this is my initial page DSIHome.aspx
I need to implement AJAX in existing project, my requirement is………
I have a menu with sub menus,, which is again generated dynamically (XML).
On clicking in any of the sub menus, I pass the argument to the URL , just like below
location.href="DSIHome.aspx?hdnfld=" + obj + "&catName="+ catName ;
this will initiate the postback and pass the values to the URL,
and I can retrieve the form content based on the URL values using QueryString,
my part here is to STOP postback,
i need to implment AJAX and stop the postback happening while clicking the sub menu
do u have any suggestion for this ?
winnie
|
|
|
|
|
The URL does not change when you use AJAX, so you need to rethink your whole approach. You could pass the values via the AJAX call and store them in jscript if you need them locally.
What's on the page, that is, what sort of navigation are you hoping to replace with AJAX ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
thanks for the quick reponse,
I havent found the method to solve the problem, i can take your suggestion using AJAX call, can you provide me with links, samples on how to implement that.
regards
winnie
|
|
|
|
|
Umm.... I asked you some questions, could you answer them ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
the page contains treeview and 2 datalist, the data on these controls is loaded based on the values on the URL,
as you said the values should be available locally ,
hope im conveying the problem in right words
regards
winnie
|
|
|
|
|
OK, you should use ASP.NET AJAX for this, which will just wrap everything for you. Trying to populate those controls using your own JS is a PITA. If you put everything in an update panel, it will just AJAX it for you.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
|
Hi Guys,
When i LogOut a user on my site a User is still able to hit the Back button in their browser and essentially view a logged in only page.
Ideal scenario would be for this page to send them to Login screen.
What would be the best way to stop this from happening?
FYI.
When a user logs in, i store a loggedIn value in a session variable.
On logout i reset this session to indicate the user is loggedOut.
I am using c# .net
Many Thanks.
|
|
|
|
|
You need to make sure the browser doesn't cache your page. If you hit refresh, does it go to the login page ? If so, this is your problem. Put Response.Cache.SetCacheability(HttpCacheability.NoCache) in your pages, preferably via a common base page ( the place where you check if the session is set is a good place to do it.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
HI friends, this question is regarding Crystal Reports in VS 2005
My report here is attached to a SP. I'm trying to pass parameters but it raises an error:
Procedure or function 'sp_wfsAppByCounsReport' expects parameter '@StartingDate', which was not supplied.
Here is my code, I'm passing the parameter. I can even trace it and the rdDocument variable has them attached after the SetParameteValue....why the report is not sending them to the SP???
Here is my code:
protected void Page_Load(object sender, EventArgs e)
{
DateTime dtStartingDate = DateTime.Parse(DateTime.Today.Month.ToString() + "/" + "1" + "/" + DateTime.Today.Year.ToString());
ConnectionInfo ciLogin = new ConnectionInfo();
ciLogin.ServerName = "myserver.com";
ciLogin.DatabaseName = "mydb";
ciLogin.UserID = "dbuser";
ciLogin.Password = "mypass";
TableLogOnInfo tbLogonTable = new TableLogOnInfo();
tbLogonTable.ConnectionInfo = ciLogin;
ReportDocument rdMonthReport = new ReportDocument();
rdMonthReport.Load(Server.MapPath("couns-month.rpt"));
rdMonthReport.SetParameterValue("@StartingDate", dtStartingDate);
rdMonthReport.SetParameterValue("@EndingDate", DateTime.Today);
foreach (CrystalDecisions.CrystalReports.Engine.Table tbTable in rdMonthReport.Database.Tables)
{
tbTable.ApplyLogOnInfo(tbLogonTable);
}
CrystalReportViewer.ReportSource = rdMonthReport;
CrystalReportViewer.RefreshReport();
}
Any help is appreciated!!
|
|
|
|
|
Is your date format correct ? Is MM/DD/YYYY what your server expects ? any need to write code that works out hte local format and uses it ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I think so. The parameters in the SP are DateTime..and I'm passing DateTime as parameters too.
|
|
|
|
|
I created one page which contain one timer which will execute some function after every 5 min and send one mail to my id. Now the problem is i m not able to stop that one after every 5 min i receive mails. I close that page so it not execute but still it is running. How to stop that timer.
|
|
|
|
|
I don't see how that is possible. How do you set your timer ? Posting code would help.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
The timer should stop when you leave your application i.e. close your web browser
|
|
|
|
|
Well, obviously. I am assuming that he's perhaps running a timer in his code behind, given that he's using it to send email. I then assume it isn't within a page, given that it runs on a timer. This would explain why it keeps running, it's server code that runs outside a page. But, unless he answers my question, it will be hard to help him further.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
sorry for late reply..
Timer timer = null;
timer = new Timer();
timer.Interval = 120000; //60 seconds (10000 - 10 seconds)
timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
timer.Enabled = true;
timer.Start();
this is in page load event and i m calling timer_Elapsed function....
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
AutoSendMailToCustomers();
}
|
|
|
|
|
Hi ,
how to display and refresh images on after the page load completed using Asp.net Ajax concepts (Updatepanel and timer control or etc ) .
like
sdfjshjdfnksandfnsandfnsdjnfsndfnsdnfmnsdmnfnsdfndsdhsdfsdjk
sdjfhsjdhfjshjfjdjfjsjdkhfjsjjdfhkjdhskjfjskhfjhjdhfjhsjjdfhjshjf
sdhgshghdghsgfhdghsghdgdghsdhsdfhdsfdhghsfhgsdhfhsgdhghsdhfshgdfgsdgfh
djhjsfjsdhjfhsjdhfjhdhfshdhfsjhdjfhsjdhfjhsjdhfjshdjfhjsdhfjsdfsdfS
jsjdhjsdjsdshdsdhsjhdjshjdhjshdjhsjdjhsjhdjs
pageload ...
pageload completed .
display the image1 on div
<asp:image mode="hold" xmlns:asp="#unknown">
delay 3 sec
display or refresh image 2 on same div
<asp:image mode="hold" xmlns:asp="#unknown">
delay 3 sec
display or refresh image 3 on same div
<asp:image mode="hold" xmlns:asp="#unknown">
thats it ..
it is a simple.. i done but i am not getting on div ?..
if u know how to do or done ..
send me replay to here
or mail me :
mails2dhanunjaya@gmail.com
Thanks ..
Dhanu
|
|
|
|
|
I am certain there's a control built into that library that does this for you, you just provide the image URLs
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi,
I'm adding a button to an existing app. I need to open a new window once this button is clicked. The new button has been added to an existing User Control and takes on all the attributes of the other buttons. Great.
I need to add an onClick event to my button in the code behind that will open a new browser via some javascript (window.open). When I add it it and run the code it renders the button with 2 onClick events (1 from the global attributes of the user control I guess) My onClick doesn't funtion (not a shock) I know I can have 2 functions running on 1 onClick - I separate with a semi-colon - how do I merge my onClick event into the existing one? Attribute.Add("onClick"),myButton creats a new one.
Any ideas welocme !!
Thanks
|
|
|
|