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


Top 5 Contributors of the Month
david stephan
Post New Web Links

Is there any event called when "Print" is selected?

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :.NET Framework
 

Hi,

i am trying to develop a tool in C# which sets some properties for a printer when "Print" is clicked from any application.

Is there any event called when "Print" is clicked from any application?

How to get the control on Printer properties upon clicking "Print" ?

Any code snippets to achieve the above task will be helpful.

 

Thanks,

Nayna




View Complete Post


More Related Resource Links

Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page

  

how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services

 

Thanks in advance


InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.

  

I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?

Thanks,
--Aaron


Trap Selected Index change event of listbox using Javascript.

  
Hi All, This is reagarding listbox selection. I have a list box with multi select option. I want to trap the selected index change event of Listbox through javascript. Item of list box can be selected using Click of mouse and also the keyboard up down key with shift. I tried onclick event to bind the javascript function. It works fine if I select by mouse, but it doesen't work for up/down key of keyboard. Thanks, Naveen

application_start event called multiple times in MVC application

  
hi, In my MVC application ,I am updating my web.config at runtime through application_start event.So, ideally it should be done only when the application is started.BUT in MY mvc application the application_start event of global.asax is being called multiple times , even when i have not restarted the application. Its being repetadly called when i am calling different actions , so the webconfig is repetedly updating & making my application very very slow. Can you please let me know , what's the reason & how to handle this .   Thanks in advance gbhatnagar    

How to Capture a DropDownList Selected Index Change Event

  
I have a gridview that receives data based on selection from a primary dropdownlist object. Works. Within the gridview, there is a dropdownlist whose selected index is based on the query from the primary dropdownlist. Works. Problem. How do I force the used to  change whatever value that the dropdownlist contains after they make their initial selection from the primary dropdownlist; except the default value of "Please make a selection". Gridview, contains a checkbox which drives whether a selected row is inserted into the data base. The databind in done using an ObjectDataSource on the presentation page, not in the code behind.   Thank you.   Ayomide 

Print a specific Access Report with selected GridView record

  
I have my code output a gridview with all the data with an option to select records. I'm trying to make a code which would allow me to select a record, and then print this record using a specific Report stored in MS Access. I've located the code to print the Report it self, but it prints ether all the records or a range. Any ideas? 

e.Result when data source was shaped? - linqdatasource selected event - LinqDataSourceStatusEventArg

  

Hello,

How do I handle using e.Result when my datasource was shaped (select new{})? example aspx markup below:

<asp:LinqDataSource ID="ldsMain" runat="server" 
        ContextTypeName="foobar.foobarDataContext" 
        TableName="GeneralInventories"
        Select="new(MainID,
                    AccountID,
                    Class,
                    Category,
                    ItemType,
                    Manufacturer,
                    MakeModel,
                    AssetTag,
                    SerialNumber,
                    Disposition.Substring(0, 2) as Status)"
        OrderBy="MainID" 
        onselecting="ldsMain_Selecting" onselected="ldsMain_Selected">    
    </asp:LinqDataSource>

1) since I shaped, it's an anonymous type right? so what do I cast e.Result to in order to be able to get at the data? 

2) I am thinking of using the selected event to handle some conditional page setup based on whether or not any results were actually found from the main query (the one that is used to bind data to a gridView via this linqdatasource control)... so I need to check for count > 0 and if it is, I need to fill a few dropdown controls based on a few new queries that will essentially be some select dis

e.Result in selected vs selecting event of linqdatasource control

  

hello,

in the selected event it seems even though e.TotalRowCount really is the total row count, when I cast e.Result to a type in order to access the actual data only the current page of data is there? not all.

IEnumerable<InventoryGridItem> items = (IEnumerable<InventoryGridItem>)e.Result;

items only has the 15 records for the current gridView page, not all the records, is this normal? If I need to access all the items in the result do I need to stick with the selecting event instead? 


Determine which picture box has been selected from a PictureBox_DoubleClick event

  

Hi,

I have a series of picture boxes dynamically created I am trying to find out how I could identify which one of the boxes has been double clicked in the PictureBox_DoubleClick event handler.

Can anyone suggest how this sort of thing may be done.

 

Many thanks


How to handle treeview selected node changed event

  

Folks,

From my below sample code, I don't want to use Sessions to handle each click event inside treeview selected node changed.

Secondly, if you suggest me to use treenode.SelectedValue then I would say my values are dyanmically generated.

Everytime a node a clicked, the selected node value is sent in the next request xml to get response and xml schema is different for each click. How do I handle this each click event other than using session variables. I thought of using Request.Item (and integrating with URL redirect property) but I don't want to use that.

 

Dim trNode As New TreeNode
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then        
            trNode.Text = "Not Postback"
            TreeView1.Nodes.Add(trNode)
            Session("Flag") = 1
        End If
    End Sub

Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TreeView1.SelectedNodeChanged
        If Session.Item("Flag") = 1 Then
            TreeView1.Nodes.Clear()
            trNode.Text = "Is PostBack"
            TreeView1.Nodes.Add(trNode)
            Session("Flag") = 2
            Return
        End If
        

OnOpening event called twice using ServiceHostFactory for WCF service

  

It seems that when a WCF service, hosted in IIS7, uses ServiceHostFactory for activation and Auto-Start is enabled in the application, then the CreateServiceHost method is called twice. If Auto-Start is disabled then it's called only once.

 Is this expected behavior? Is there a way to suppress this?

This is a problem because it loads two instances of a ServiceHost derived class and code in its OnOpening and OnClosing events executes twice.  I need the a

is there a event called 'ondrop'?

  

hi,

i'm using dragpanelextender,and,i want to save the position of the panel to the profile after user drop it,

but i'm wondering which event should i use to do the saving

i tried onmouseup,but it doesn't work in IE--user triggers the onmouseup event only if they didn't move it!

this post,http://forums.asp.net/p/1188549/4134284.aspx#4134284,tells that there's a event called "ondrop"

but my vs and browser told that there's no such thing.

so,what should i do to deal with this problem.

thx for any suggestion and examples.


gridview dropdownlist selected indeex change event

  

 

I bind the ddl as name column in gridview and age as textbox in the next column.

 void bind()

{

 SqlCommand com = new SqlCommand("Select id,name from employee", con);

SqlDataAdapter da = new SqlDataAdapter(com);

DataSet ds = new DataSet();

da.Fill(ds);

GridView1.DataSource = ds;

 GridView1.DataBind();

SqlDataAdapter da1 = new SqlDataAdapter("select id,name from employee", con);

DataSet ds1 = new DataSet();

da1.Fill(ds1);

for (int i = 0; i < GridView1.Rows.Count; i++)

{

 DropDownList ddl = (DropDownList)GridView1.Rows[i].FindControl("ddlname");

ddl.DataTextField = "Name";

 ddl.DataValueField = "Id";

ddl .DataSource = ds;

ddl.DataBind();

}

 }

the above coding i fallow but in selelected indexchange event i have to dispaly the age of particular name in gridview.


Cannot get values of a SPFieldMultiChoice value selected in an Event Handler

  

I have a document Library in SharePoint that I am trying to setup a After Update event handler. The event handler should do the following:

  • When a user assigns a technician to do an update, then an email is sent to the tech. The tech is selected by a Multiple Choice field.
  • When a user changes the status to Closed, an email is sent. The status is a drop-down field.

What I would like to be able to do is to check if the status = "open", "working" or "on hold", and if it is one of these statuses, I need to check to see who is assigned and send that tech an email.

I'd also like to check to see if the status = "closed" and then send only the user an email.

They work separately, but when I try to add the logic together, I get an error in my Application log as follows:

Windows SharePoint Services 3, General, Event ID 6875.  The parameter 'to' cannot be an empty string. Parameter name: to

Here's my code:

MenuItem Click event handler not getting called from a HierarchicalDataTemplate EventSetter Style

  

I have a user control that contains another user control based on a button. When the button is clicked I have it show a context menu that is bound to a enumeration that shows a dynamic set of menu items. I use a HierarchicalDataTemplate to generate the MenuItems and use a style with an eventsetter to define a menu click handler to be called when any of the menu items are clicked. The context menu and its menu items gets displayed properly but the event handler is not getting called. Any ideas? Below is the section of the xaml where the user control is defined and below it is the code behind with the event handler.

Thanks! 

 

<Controls:WebcastButton x:Uid="videoConfigureButton" x:Name="videoConfigureButton" 
                   

CheckedChanged event handler not called

  

Hi everyone,

I'm relatively new to ASP.NET and I got stuck trying to create my first simple server control. I'm having a hard time capturing a CheckedChanged event of a check box in a GridView when wiring everything via code. I tried to create handler when creating new instance CheckBoxColumn : ITemplate class and in the handler of RowDataBound, the code executes but the event handler of the checkbox it is never called. If anyone would have any feedback on the subject it would be of great help.

Thank you,
Radek


// Code behind

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class _Default : System.Web.UI.Page
{
public class Person
{
private string _FirstName;
public string FirstName
{
get { return _FirstName; }
set { _FirstName = value; }
}
}


void Page_Load(object sender, EventArgs e)
{


List<Person> lstPeople = new List<Pers

Dropdown list in ASP.NET - How to get value selected

  
am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help
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