.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Page.ClientScript.RegisterClientScriptBlock does not work

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
 
All, I am new to .Net and webpart. What I try to do is to create a griedview webpart with a functionality of export to excel. The gridview also can drildown another gridview. The drilldown work as expected. When click export to excel link button it works ok, too. The problem is when comeing back to the gridview to click any row, it stops to drilldown. If I want to use export to excel link it stop working also. Only refresh page can make it work again. I did research and found a solution, that is, to implement a javascript to solve the problem. I follow references from microsoft site as shown below. But it never works. Can anyone tell me what wrong I did? Thanks a lot   private const string ByeByeIncludeScriptKey = "myByeByeIncludeScript"; private const string EmbeddedScriptFormat = "<script type='text/javascript'>function ClientScript(){ _spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;}</script> "; //Constructor  public DataViewer() {  public DataViewer()this.PreRender += new EventHandler(DataViewer_PreRender); } //Client Script registration   private void DataViewer_PreRender(object sender, System.EventArgs e) { if (!this.Page.ClientScript.IsClientScriptBlockRegistered(ByeByeIncludeScriptKey))this.Page.ClientScript.RegisterClientScriptBlock(typeof(DataViewer), ByeByeI


View Complete Post


More Related Resource Links

Use ClientScript.RegisterClientScriptBlock in User Control

  
I added 'Imports System.Web.UI' to the code behind for a user control so that I could dynamically create JavaScript using ClientScript.RegisterClientScriptBlock. However when I declared the variable, I got the following error message'System.Web.UI.ClientScriptManager.Friend Sub New(owner As System.Web.UI.Page)' is not accessible in this context because it is 'Friend'.      So what is the proper way to declare the object variable?

How does "Alert Me" work with simple web page?

  
In another post (http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/83ec9566-0357-4f40-9388-f364e87c1bd4/)  I've learnt how to make simple web pages in MOSS 2007. Then I want to "subscribe" some users using the "alert me" function but it doesn't seem to work.  Do I miss something or "alert me" doesn't work with simple web pages?  

making page work after DB update in Form View

  
I could really use some help with this issue. I have a DropDown that allows the selection of a Category Code. The selection populates a Gridview with details of records matching the Category Code. I have only enabled the Select option on the Gridview, which when clicked populates a Formview in Edit Mode with the full record information. When editing is complete and the Update link is clicked, I can not get the page to properly reload/postback. When another Category Code is selected from the Drop Down the Gridview does not report a list of records.   Any help would be greatly appreciated.   Thanks,              

Repeat Report Item with Data Region on Every Page - doesn't work

  
Hi All, The Repeat Report Item with Data Region on Every Page property does not work - or atleast not the way i would expect it to. My report contains a header which is the Report Name. In the report body - I have text box with the company name, pulled from a data set. Below the company name i have a line, followed by a text box displaying the selected parameters. When I run the report, the first page displays all information as expected. However, subsequent pages only display the report header (report name) with the table butted up against it. I have tried setting the Repeat Report Item with Data Region on Every Page to true (and the data region to my table) for the Company Name text box, the line, and the parameters text box. This has no affect i.e. page 2, page n... are not printing the three items. Any suggestions much appreciated. Thanks.  Clay

What is the best way to develop a multi-page Windows Application (i.e. work like a web app - no pop-

  
Hi, I have implemented a toolstrip and want to use this as my menu to change current page (just like a web application). I DON'T want extra forms popping up.    I ask this question as in the past I have always used TAB Control, but now that I'm using the toolstrip I don't require the Tab Buttons themselves. Can I hide these buttons, during runtime. Obviously I only need one tab displayed at a time. I have looked at using a panel, but that means I can't flick between panels during design stage. Any suggestions would be really appreciated. Thanks. John.      

What is the best way to develop a multi-page Windows Application (i.e. work like a web app - no pop-

  

Hi,

I have implemented a toolstrip and want to use this as my menu to change current page (just like a web application). I DON'T want extra forms popping up.   

I ask this question as in the past I have always used TAB Control, but now that I'm using the toolstrip I don't require the Tab Buttons themselves. Can I hide these buttons, during runtime. Obviously I only need one tab displayed at a time.

I have looked at using a panel, but that means I can't flick between panels during design stage.

Any suggestions would be really appreciated.

Thanks.

John.

 

 

 


MVC doesn't work once is published in the WEB, "Error 404 Page Not Found" vs2010 iis7 mvc 2rc2 I up

  

Hi Everyone.

 I'm doing the samething in my two differents pc.

1) Windows 7,  vs2010 rc, mvc 2rc2, .Net 3.5

2) Winodws xp, vs2008, mvc 2rc2, .Net 3.5

My Hosting is in GOdaddy IIS 7, .Net 3.5.

I created a new project in both computers, i build it, i copied the 3 dll's files in the bin folder (System.Web.Mvc,  System.Web.Routing, system.Web.Abstractions), and i publish them...., i go to my website (www.luisbragagnolo) both same problem "Page Not Found"

 I tried many blogs...many advices...nothing yet....

 Any other new Advice people? Thankssssssss


The Group Work Site template has the "What's New" web part on it's home page and I have the follow

  

I can't find that web part as something I can use elsewhere? As in, I can't add that web part on other pages made even on the same site. What would be ideal is to have that web part available to add as needed to other sites/pages of course. As it stands, for me it seems the only place I can use that web part is on the home page of a new "Group Work Site", i hope that I'm wrong. I've tried exporting the web part, but the importing does nothing when trying to import it to other sites, of course other 2010 sites. Please let me know how I may add that web part to my available to use web parts please.

 

:)


UpdatePanel Trigger dont work with Master Page

  

Hi

I got a aspx page using a master page. In the aspx page, i got multiple Content section:

<asp:Content ID="Content1" ContentPlaceHolderID="CPHSubHeader" runat="server">

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
    <ContentTemplate>

<asp:Panel ID="Panel1" runat="server">
            <asp:table id="tblSubHeader" runat="server" width="100%" bgcolor="white">
              <asp:TableRow runat="server">
                <asp:TableCell ID="TableCell1" runat="server" Width="50">
                    <asp:Label runat="server" Text="Area" Font-Names="Arial" Font-Size="14px"></asp:Label>
                </asp:TableCell>
                <asp:TableCell ID="TableCell2" runat="server" Width="100">
                    <asp:DropDownList runat="server" ID="ddlArea" AutoPostBack="true" OnSelectedIndexChanged="DDLArea_SelectedIndexChanged"></asp:DropDownList>
                </asp:TableCell>
                
                <asp:TableCell ID="TableCell3&q

Copy images to page layout or to wiki page - looking for the user-friendly way of work!

  

Hi,

I found that when copy & paste text and images (from internet site / from word etc.) -

when i'm coping to page layout as "Article Page"  - all the content include images is pasted at once and no farther configuration is needed.

When i'm coping to a wiki page - the images are not always being copied and i have to define the target images library it will be kept in (which makes the edit of wiki page more complex and less user-friendly).

Am i missing something? should i configure something in the "page content" field of the wiki page? or activate any site feature?

thanks


Trouble making collection page work "/

  

 //CollectionPager1.DataSource = empresasBLL.Find(a => a.ID_EMPRESA.Equals(1)).ToList();
            //CollectionPager1.BindToControl = dtlEmpresas;
            //dtlEmpresas.DataSource = CollectionPager1.DataSourcePaged;
           


Hello I´m using this code to make the collectionPage work with the datalist.

but when I run the application it dissapears with the data.


does anyone know what I´m doing wrong?


the ID_EMPRESA

java doesnt work in content page

  

i have java script in content page setting the break point fire it and nothing happend

it looks like it ignores the script any idea? 


How to make it work multiple "I need to.." webpart in the same page..

  

I am trying to create multiple "I need to.." web parts in the same page.  But only first created web part working.  Rest of all the web parts either not respond after click "GO" button or goes to the first web parts selection, even click on another web part.  I am using Team Collaboration web page.  I tried to create different custom list to different web part did not work, and link to the same custom link with different filter settings as well did not worked.

Some search across the web showing few people have same problem, but no clear fix found.  Does anybody know some sort of tweaking or coding for this problem..

I am using Sharepoint 2007 with MOSS2007..

 


DBCC SHRINKFILE: Page 4:11283400 could not be moved because it is a work table page.

  

 

Hi,

 

I issued this command on Tempdb but it doesnot shrink the file.

 

dbcc shrinkfile (tempdev_3,1)

go

 

Messages:

-----------------------------------------------------------------------------------------------------------

DBCC SHRINKFILE: Page 4:11283400 could not be moved because it is a work table page.

-----------------------------------------------------------------------------------------------------------------------------------------------

 

I have  checked that there are no tables associated with any user in tempdb. Any help is appreciated.

 

Regards,

Razi


How to jquery get function work in different folder page i mean.....

  

this is work

$.get("QC_GridView.aspx",{ QcSearch: "" + "All" + "" },
                        function(data) {
                  $('#ShowQC').html(data);


but this is not work   how to run below code

$.get("UserControl/QC_GridView.aspx",{ QcSearch: "" + "All" + "" },
                        function(data) {
                  $('#ShowQC').html(data);


Site Default page does not work after the asp.net upgradation (2.0 to 4.0)

  

Hi All,

we are upgrading the asp.net 2.0 web application to asp.net 4.0. 

we have the many sub folders with default page (default.aspx)

and we are using the link like,

<domainname>.com/
<domainname>.com/folder1/
<domainname>.com/folder2/
<domainname>.com/folder3/
<domainname>.com/folder4/

it is working fine in asp.net 2.0

after the upgradation process,  we didnt get above the  URLs. i have checked site default page settings (in IIS "Document" default page settings), and default.aspx page is shows under settings.
 

the site url  "<domainname>.com/" also does not working. if we call "<domainname>.com/default.aspx"  then worlking.

 How can i fix that error?


AD qurey page does not work on remote machine...

  

First, I apologize if this has been answered somewhere, but I feel I have been searching forever.

I am trying to setup code that will allow me to pull a domain users first and last name from the AD.  I have the code working successfully from the server browser, but it will not work from a remote browser.  The error I get (when using 2-3 different versions of the code) is

Exception Details: System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred.

I have Authentication set to Windows and Impersonation set to True.  Again, both sets of code work on the server, just not from any remote box.

The IIS server is set for Integrated Windows Authentication.

Here is one version of the code

Dim ADUser As System.DirectoryServices.AccountManagement.UserPri

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend