Click here to Skip to main content
16,005,473 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionASP.NET Pin
boriz_spider27-Apr-06 6:44
boriz_spider27-Apr-06 6:44 
AnswerRe: ASP.NET Pin
minhpc_bk27-Apr-06 12:40
minhpc_bk27-Apr-06 12:40 
GeneralRe: ASP.NET Pin
boriz_spider28-Apr-06 18:24
boriz_spider28-Apr-06 18:24 
QuestionImportant: ASP.Net DropDownList Problem when it is AutoPostBack Pin
Irs_ahmad27-Apr-06 4:37
Irs_ahmad27-Apr-06 4:37 
QuestionSorting Pin
mayl27-Apr-06 4:15
mayl27-Apr-06 4:15 
AnswerRe: Sorting Pin
isroavi27-Apr-06 20:34
isroavi27-Apr-06 20:34 
GeneralRe: Sorting Pin
mayl28-Apr-06 1:35
mayl28-Apr-06 1:35 
QuestionHow to Cancel a DataView's ButtonField PostBack? Pin
-Dr_X-27-Apr-06 3:55
-Dr_X-27-Apr-06 3:55 
I have tried combinations of the following to cancel the postback of a ButtonField. I am obtaining the data to view via Ajax and do not want the postback. Any ideas?

Code Behind in the dgData.RowDataBound event:
If e.Row.RowType = DataControlRowType.DataRow Then
  e.Row.Attributes.Add("onclick", "javascript:return viewRow(" & CType(e.Row.DataItem, BusinessObjects.Course).CourseID.ToString & ",this);")
End If
Or without the "return"
e.Row.Attributes.Add("onclick", "javascript:viewRow(" & CType(e.Row.DataItem, BusinessObjects.Course).CourseID.ToString & ",this);")
HTML:
<asp:ButtonField Visible="true" ImageUrl="../images/ViewSearch.gif" ButtonType="Image" Text="View Record" >
  <ItemStyle HorizontalAlign="Center" Width="20px" />
</asp:ButtonField>
JavaScript
function viewRow(id, row) {
  try {
    if (!(previousRow==null)) previousRow.backcolor= row.backcolor; //reset the previous row's backcolor
      previousRow = row;
      row.style.background="lightblue";
      document.getElementById("<%=tblEdit.ClientID %>").style.display="none";   //Hide and display HTML 
      document.getElementById("<%=tblView.ClientID %>").style.display="inline"; //tables from the client
      requestSimpleService = CourseList.GetCourse(id, populateCourse, onError); //Ajax call
      return true; //Tried false as well
    } catch (e) { alert(e.message); 
  }
}
Note I am using the "<%=tblView.ClientID %>" due to using masterpages.

Thanks,
Michael




I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
AnswerRe: How to Cancel a DataView's ButtonField PostBack? Pin
minhpc_bk27-Apr-06 5:45
minhpc_bk27-Apr-06 5:45 
AnswerRe: How to Cancel a DataView's ButtonField PostBack? Pin
NeverHeardOfMe27-Apr-06 7:01
NeverHeardOfMe27-Apr-06 7:01 
QuestionPivot tables Pin
sohne27-Apr-06 3:49
sohne27-Apr-06 3:49 
AnswerRe: Pivot tables Pin
Paddy Boyd27-Apr-06 6:33
Paddy Boyd27-Apr-06 6:33 
GeneralRe: Pivot tables Pin
sohne28-Apr-06 0:48
sohne28-Apr-06 0:48 
QuestionHow to make Thumbnails of an Image and again show it as big? Pin
MudkiSekhon27-Apr-06 3:36
MudkiSekhon27-Apr-06 3:36 
AnswerRe: How to make Thumbnails of an Image and again show it as big? Pin
KrIstOfK27-Apr-06 4:53
KrIstOfK27-Apr-06 4:53 
QuestionOpen and save Word doc to server??? Pin
JimFeng27-Apr-06 3:35
JimFeng27-Apr-06 3:35 
AnswerRe: Open and save Word doc to server??? Pin
NeverHeardOfMe27-Apr-06 3:58
NeverHeardOfMe27-Apr-06 3:58 
GeneralRe: Open and save Word doc to server??? Pin
JimFeng27-Apr-06 4:40
JimFeng27-Apr-06 4:40 
GeneralRe: Open and save Word doc to server??? Pin
NeverHeardOfMe27-Apr-06 5:00
NeverHeardOfMe27-Apr-06 5:00 
QuestionSeting values in a Web User Control Pin
Ista27-Apr-06 3:17
Ista27-Apr-06 3:17 
AnswerRe: Seting values in a Web User Control Pin
minhpc_bk27-Apr-06 5:49
minhpc_bk27-Apr-06 5:49 
GeneralRe: Seting values in a Web User Control Pin
Ista27-Apr-06 9:52
Ista27-Apr-06 9:52 
GeneralRe: Seting values in a Web User Control Pin
minhpc_bk27-Apr-06 12:37
minhpc_bk27-Apr-06 12:37 
GeneralRe: Seting values in a Web User Control Pin
Ista27-Apr-06 16:51
Ista27-Apr-06 16:51 
QuestionRetriving variables............ Pin
daviiie27-Apr-06 3:15
daviiie27-Apr-06 3:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.