|
Hi
you should use litral control when you want to a string witch has html content even it has img tag but pay attention if your string has html content it works if that string has a/some asp.nettag like <asp:image> it dowsnt work
strind str = "..."; // a string with just html tag
litral1.text = str;
just this
bye
|
|
|
|
|
Please don't cross post. This is really bad form.
|
|
|
|
|
Sorry I am using this first time, I didn't know that.
|
|
|
|
|
hi guys
i have a website that in button execute some methods and with this code
response.write("alert(\"messge\") ");
and then
response.redirect("a.aspx");
now alert do not display
whats problem ?
thanks a lot
|
|
|
|
|
If I understand, when a user click on the button. In the event you have:
void btnTest_Click(object sender, EventArgs e)
{
Response.Write("<Script>alert('messge') </Script>");
Response.Redirect("page2");
}
in this case, the redirection is make and the page with the button cannot display the alert.
For resolve you problem try:
<script language="javascript">
function onButtonClick()
{
alert("message");
document.location = "http://www.google.fr";
}
</script>
<asp:Button ID="btnTest" runat="server" OnClientClick="javascript:onButtonClick()" />
If you have some thing to execute in the event, you can make this
void btnTest_Click(object sender, EventArgs e)
{
Response.Write(@"<Script> alert('message');
document.location = 'http://www.google.fr'; </Script>");
}
modified on Tuesday, November 30, 2010 8:04 AM
|
|
|
|
|
If you're doing a Response.Redirect("someUrl"). The redirect will be done on the server side.
That means you're transfering control to the execution of page a.aspx. The former writing of
that script tag is hereby irrelevant.
Cheers
Manfred
|
|
|
|
|
|
Who voted 5 for this unreadable garbage?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
In my Asp.net WebApplication When Im Running A Select Query Im Getting A Error Like This:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
I Tried A lot Of Ways For Solving This Problem..But No One worked.
Thanks In Advance,
Vishnu
|
|
|
|
|
vishnukamath wrote: I Tried A lot Of Ways For Solving This Problem.
Have you tried
cmd.CommandTimeout = 10000;
|
|
|
|
|
thanks for replying Me Sir,
Im Using The Select Query to Get the data in to datatable by using dataadapter. when im debugging and when the cursor came to adapter.fill(datatable). it is going into the catch and the error is comming like:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
thanks in advance,
vishnu
|
|
|
|
|
vishnukamath wrote: Im Using The Select Query to Get the data in to datatable
Post the code you are using
|
|
|
|
|
Is the table very large, or are there a bunch of joins in the query?
Are the tables being referenced properly indexed. If they aren't, doing so could substantially increase the performance of the query.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
I would use the MS-SQL Profiler to obtain statistics about the query you are trying to execute. Check the execution plan and verify that you are not doing lots of table (or index) scans.
Your problem also sounds like you might be trying to retrieve too many records at once. How many records are expected to be returned ?
Maybe you should be using a data reader.
Just a few thoughts.
good luck.
|
|
|
|
|
Why Are You Posting Everything In Title Case? Isnt It A Lot Of Work To Keep Pressing The Shift Key At The Start Of Every Word?
|
|
|
|
|
vishnukamath wrote: I Tried A lot Of Ways For Solving This Problem
I don't think you might have tried.
This is a simple problem having simple solution.
SELECT statement inside your program could not be accomplished with the default connection time limit. so Try by increasing connection timeout inside your connection object.
I bet it will work like a charm.
Thanks,
Hiren
Regards,
Hiren.
"We owe a lot to the Indians, who taught us how to count, without which no worthwhile scientific discovery could have been made." - Einstein
Microsoft Dynamics CRM
|
|
|
|
|
hi guys,
i have simple table without primary key that stores two foregin keys. table contains data about which doctor has which patient.
DoctorID | PatientID | 1 | 1 | 1 | 3 | 1 | 4 | 2 | 1 | 2 | 15 |
what i am trying to accomplish is this:
<asp:SqlDataSource ID="sds" runat="server"
ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
SelectCommand="select * from DoctorPatient"
UpdateCommand="update DoctorPatient set DoctorID=@DoctorID,PatientID=@PatientID where DoctorID=@DoctorID and PatientID=@PatientID">
</asp:SqlDataSource>
<asp:DetailsView runat="server" ID="dv"
DataSourceID="sds" AllowPaging="true"
AutoGenerateEditButton="true">
</asp:DetailsView>
but editing items wont work... can i set SqlDataSource - DetailsView to modify this table without adding primary ID column?
|
|
|
|
|
This is an example of a Join Table and you should define a primary key on it. In this case it will be a composite key consisting of DoctorID and PatientID. Without this you have the potential for multiple entries with the same doctor and patient.
Your update statement makes no sense either. Inserting actual values you can see that nothing will be updated.
UPDATE DoctorPatient
SET DoctorID = 1
PatientID = 3
WHERE DoctorID = 1 AND PatientID = 3
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Is there really just those 2 columns in this table? What does the link represent? How is the UI making changes to this data?
As has already been said you are updating the data with the same values and therefore there will be no visible change. But are you relying on knowing the values that are effectively being deleted?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
musefan wrote: Is there really just those 2 columns in this table ?
This is quite common (its called a cross-reference or Xref table), when joining two tables together in a many-to-many fashion. For example a Author can have more than one book, but a book can have multiple authors. If you were to express this in a Database, you'd want to have a two column table as above, additionally, as in the previous post, you'd want to make both columns a [composite] PK.
|
|
|
|
|
Sorry. I didn't quite mean it like that. I know the use of this kind of table and have used many times before. I was more trying to get what it was used for in this instance. Like What is the relationship? Perhaps an appointment. That's why I ask is there no other fields
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Why are you editing? With a table like that the relationship is binary. It exists or it doesn't. There is nothing to edit. All you should need is insert and delete. If patient 15 wants to change doctors from 2 to 1, you should just delete the 2,15 row and add a 1,15 row. Otherwise add a surrogate key. I would suggest adding a surrogate key anyway since there are probably other pieces of data you will want in the future like date. When did the patient start seeing that doctor? That would be good for reporting on things like how many new patients does the doctor get each month.
|
|
|
|
|
As said above your statement doesn't make sense, so please consider the following :
"update DoctorPatient set DoctorID=@NewDoctorID,PatientID=@NewPatientID where DoctorID=@OldDoctorID and PatientID=@OldPatientID"
Please consider other suggestions too before implementing this.
|
|
|
|
|
hi guys, thanks for advice and info, but i found a way how to do this. so if anyone have same problem try this solution:
<asp:SqlDataSource ID="sds" runat="server"
ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
SelectCommand="
select
DoctorID,
PatientID,
DoctorID as DocOldID,
PatientID as PatientOldID
from
DoctorPatient"
UpdateCommand="
update DoctorPatient set
DoctorID=@DoctorID,
PatientID=@PatientID
where
DoctorID=@DocOldID and
PatientID=@PatientOldID">
</asp:SqlDataSource>
<asp:DetailsView runat="server" ID="dv"
DataKeyNames="DocOldID,PatientOldID"
DataSourceID="sds" AllowPaging="true"
AutoGenerateRows="false"
AutoGenerateEditButton="true">
<Fields>
<asp:BoundField DataField="DoctorID" />
<asp:BoundField DataField="PatientID" />
</Fields>
</asp:DetailsView>
|
|
|
|
|
Hi ,
I need to add OnClick and OndblCick Attributes in RowDataBound event ,
OnClick for get first cell value and store it in Session and OndblCick for redirecting to newpage.aspx.I tried with
below code in RowDataBound, and i'm not using template fields for gridview directly bindig datasource(template fileds not require for me).
e.Row.Attributes["ondblclick"] = ClientScript.GetPostBackClientHyperlink(this.gv_commondataList, "Select$" + e.Row.RowIndex,true);
-----
single Click :
------------
i added one btn_Hidden control in Display none Div tag. This Button Click event firing properly but gv_commondataList_SelectedIndexChanged event not firing on row Double Click
e.Row.Attributes.Add("onclick", "document.getElementById('" + hd_ItemValue.ClientID + "').value=" + e.Row.RowIndex + ";document.getElementById('" + btn_Hidden.ClientID + "').click();");
Could you please suggest me better way to solve my problem.
Regards,
vishnu.
|
|
|
|