|
Provided your bindSelectedFields() and bindReport() are correct, this should work.
But only if you're actually performing a Postback (clicked button or similar). It won't work on a first visit per session basis if your requesting the page via a GET (such as clicking a link, or navigating directly to the page in the address bar.
|
|
|
|
|
thanks for reply, Would you please give me more information bz yours is not so clear for me.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
hi,
i have developed a simple form which have only one button and when user click on button then just server datetime will be shown by
icallback. few days back it was working but now i saw it is stop working. i am running the program from VS2005 IDE. i just can not understand
why it is not working. i am getting two error and
the errors are 1) WebForm_DoCallback is not defined
2) WebForm_InitCallback is not defined
please help me how to fix this error.
here i am giving my code
html
-----
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BasicCallBack.aspx.cs" Inherits="BasicCallBack" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script language=javascript>
function GetOutputFromServer(strOutput)
{
alert(strOutput);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnVal" runat="server" OnClientClick="CallServerMethod('1','2');return false;"
Style="left: 455px; position: relative; top: 204px" Text="Get Server Date" /></div>
</form>
</body>
</html>
codebehind
-------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class BasicCallBack : System.Web.UI.Page, ICallbackEventHandler
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsCallback)
{
ClientScriptManager csm = Page.ClientScript;
String callbackRef = csm.GetCallbackEventReference(this, "arg", "GetOutputFromServer", "");
String callbackScript = "function CallServerMethod(arg, context) {" + callbackRef + "; }";
csm.RegisterClientScriptBlock(this.GetType(), "CallServerMethod", callbackScript, true);
}
}
public void RaiseCallbackEvent(String clientArgs)
{
}
public string GetCallbackResult()
{
return DateTime.Now.ToLongDateString();
}
}
please help me to fix this error.
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: few days back it was working but now i saw it is stop working.
The code you have presented works for me,
(visual studio 2008) I suspect something
on your machine was changed , I couldn't
guess what ?
Try to do a "Restore" back to when it was
working for you.
|
|
|
|
|
How are you running it? Are you using the developer web server or IIS? If you are using IIS then you should reinstall the framework for the site using the regiis command. For exact syntax check google.
|
|
|
|
|
i am using the developer web server means i run the code from VS2005 IDE. i am not using IIS.
tbhattacharjee
|
|
|
|
|
I have a User Control that has a custom property, which I want to set by a theme.
The custom property is used in javascript that is injected into the page by a
Page.ClientScript.RegisterStartupScript method in Page_Load.
Basically I do the following :
- Placed a [Themeable(true)] attribute above my user control class.
- I register my user control in web.config.
<pages styleSheetTheme="Sunset">
<controls>
<add tagPrefix="UC" src="~/UserControls/MyUserControl.ascx" tagName="MyUserControl"/>
</controls>
</pages>
- Placed a skin file under Sunset directory in App_Themes with content :
<UC:MyUserControl runat="server" CustomColor="#FF0000" />
At runtime everything works fine, but in the designer I keep getting the error :
Error Rendering Control
An unhandled exception has occured.
There was an error parsing the theme: The control type "System.Web.UI.UserControl" cannot be themed.
What am I missing here ?
tia
|
|
|
|
|
I'm having the same problem and haven't got any clue yet.
|
|
|
|
|
hello everyone
I would like to know how to do a double click on a gridview in asp.net / c # to open a page that displays the details of the column selected, I do a lot of research but I don't understand, please i need your support and thank you in advance
|
|
|
|
|
May be this Help
you can do this in rowdatabound event of grid
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#ffffff';"); here u have to find row and column what u selected from grid by javascript, then pass these ids in check page.
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#000000';");
e.Row.Cells[3].Attributes.Add("onmouseover", "javascript:window.open('check.aspx?id="+ val1+"','large','width=300,height=300,toolbar=0,menubar=0,scrollbars=0,location=0,resizable=0')");
|
|
|
|
|
thank you very much for your help
if you want I want to know "+ val" + it means what???
|
|
|
|
|
Here I write the code in RowDataBound:
e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';this.style.background='#FFF5E6'";
e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';this.style.background='none'";
e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this, "Select$" + e.Row.RowIndex);
and to redirect to another page I write in SelectedIndexChanged:
GridViewRow selectedRow = GridView1.SelectedRow;
Label idLabel = (Label)selectedRow.FindControl("Label1");
Response.Redirect("aff.aspx?StructureId=" + idLabel .Text);
but the last redirect code not working
|
|
|
|
|
|
thank you very much, I will read it in order to have a solution, even if it works ruien my code that redirects to another page that does not work
|
|
|
|
|
Hi
I have a problem with checking if Flash installed on the user's browser in Internet Explorer, Firefox and Chrome(mainly). When the loads the page, it first checks for the flash using client script and I have to pass that(if it's installed or not) to the page. I have the client -sciprt on User Control and my problem here is to pass the result to the code-behind code of the usercotnrol.
Here is my client-script code on user control:
on error resume next
If MSDetect = "true" Then
For i = 2 to 10
If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then
Else
flashinstalled = 2
FlashVersion = i
End If
Next
End If
If flashinstalled = 0 Then
flashinstalled = 1
End If
Can any one give me idea please! I am stuck here!
Thanks in advance.
--
http://ashakthi.blogspot.com
http://kids-articles.blogspot.com
|
|
|
|
|
Hi,
Rather than roll-your-own algorithm, you could use an established JS libary such as swfobject[^] although this is aimed at selectively displaying flash if installed it does have a swfobject.getFlashPlayerVersion() method that will return the installed flash version.
Regards,
Martin
|
|
|
|
|
Use an ASP:Hidden control and in your javascript set its value using something like
var hiddenField = document.getElementById('<%=hidHasFlash.ClientID %>');
hiddenField.value = flashinstalled
And please don't use the words true and false as strings in conditionals. It hurts my eyes.
|
|
|
|
|
Can we use both C# and VB language in same aspx page?
|
|
|
|
|
no you cant use them in same page.
|
|
|
|
|
You can only use one language per page, as the code-beside is compiled (either at run time or compile time) and you an only compile one language into a single assembly.
However, you can have multiple pages that have different code-beside languages. If you are using the web application project model, this will not work as only one assembly is produced. Instead you must use the web site model, and specify the codeSubDirectories setting in the config file.
Although, why mix c# and vb.net? It is all .Net anyway. Just pick one and stick to it. Translating code from one to the other is simple enough. If you can't do the translation yourself there are hundreds of tools and websites that can do it for you.
|
|
|
|
|
The Man from U.N.C.L.E. wrote: there are hundreds of tools and websites that can do it for you.
All of which do an awful job.
|
|
|
|
|
Not at all, although I agree there are some terrible web sites out there.
I use SharpDevelop and most of the time it translates correctly. I have to say I don't translate code that much as I just write in whatever language is appropriate, but SharpDevelop definately does the job, and does it well.
Another solution would be to compile the code and use .Net Reflector to read it from the assembly. That outputs to C# or VB, along with other languages, and translates perfectly.
|
|
|
|
|
I dont think so, but yes you can use in the same project.. for that you can have different classes both C# or in VB.put it in appcode folder, make entry in web.config and now you can these classes throughout in your application. for delatills have a look in the following link
Click here
|
|
|
|
|
Yes, you can use both language by using different master page
Farogh Haider
Web developer
|
|
|
|
|
Hi Guys,
Quick question...
Is it possible to display a page from one location in an ASP.NET page?
I have an intranet application in ASP.NET 2.0 that I want to display some fileshare pages which are on our existing sharepoint portal within my site so I can keep all my menus etc for navigation.
Thank you,
oooo, the Jedi's will feel this one....
|
|
|
|