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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

GetPostBackEventReference Help needed

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :ASP.Net


I am currently developing a custom web control. It is a textbox using jQueries autocomplete to select a value. This select happens on the client side. What I want to happen is that when the user selects an item the Selected Value and Selected Text must be sent to the server.

No I got the postback to work fine from Javascript. But I want to be able to add the values that the user selected in javascript to be sent in the event argument.

Currently I have the following.

1. On the custom controls OnPreRender Event I have the following. Which creates the script for the postback (CodeBehind)

 protected override void OnPreRender(EventArgs e)
            string Javascript = @"<script type='text/javascript'>
                                        function DoPostBack(SelectedValue,SelectedText)
                                            " + Page.GetPostBackEventReference(this, @"SelectedValue")

                                        + @"}
            String scriptBlock = Javascript;
            this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Script Name", scriptBlock, false);

View Complete Post

More Related Resource Links

Response.BinaryWrite help needed


Hi all

Im new to .NET and stuck now, so i hope anyone can help my with my problem.

I have a MS SQL database where i have stored some documents as Binary data. I cant figure out how to retrieve them and show/download them in my browser.

I found some guides online and have try to put something together.


private void Write()
 int id = 0;
 string strID = Request.QueryString["id"];
 int.TryParse(strID, out id);

 var db = new ModelDataContext();
 var doc = db.DocumentDatas.Where(x => x.ID == id).FirstOrDefault();

 byte[] byteArray = File.ReadAllBytes(doc);


How do i fill the byteArray with the data?

Thanks in advance :)


help needed: Ldap User authentication using userDN and password



Is it possible to authenticate a user using userDN and password? If so, then tell me the syntax.So far i have tried to authenticate using username and password from my c# code using directoryentry which takes the parameters like domainname,username and password. But i need to authenticate using Userdn and password.

helped needed: ASP LDAP authentication failed in IE 8


I use the following code to do the user authentication through Active Directory using LDAP.

entry = new DirectoryEntry("LDAP://" + server, user_name, password);
if (!string.IsNullOrEmpty(entry.Name))
EmployeeNetId = entry.Username.Substring(0, 3);

// Retrieve EmployeeId, and Employee Full Name
EmployeeId = -1;

It works for Chrome, Firefox with no problem. But with IE 8, it works sometimes, and failed on some computers. When it failed, I figured that I need to check SSL 2.0 in IE 8 Internet Options.  It's weird because in those computers that IE 8 works, SSL 2.0 is also unchecked.

Am I using some deprecated method? Or How do I specifiy the SSL version options in the LDAP connection?

difference between GetPostbackEventReference and GetCallbackEventReference



Hi All,

I was working with these two methods of ClientScriptManager class, but still not able to understand it properly.

Any one  have work on experience with these methods, want to know the difference between

GetPostbackEventReference and GetCallbackEventReference.

Friends, please dont post any urls. I also searching through different articles, but seened only definitions without any proper explained examples.

Help needed in selecting coulmns from 2 tables using entity framework


Hi all,

I have two tabels as mentioned below. I am using entity framework and vs2010.I am not able to write linq query to get data from both the tables. there is one to many relationship(for one category ther can be multiple articles). Please help me out as this is very urgent. Thanks in advance.

1) Article

ArticleID bigint Unchecked
CategoryID int Unchecked
ArticleName varchar(500) Unchecked
ArticleDesc nchar(1024) Unchecked

Is the REST Starter Kit still needed with WCF 4?


The REST Starter Kit was targeted at WCF 3.5. I am wondering if it is still needed with WCF 4?

WCF over mobile modem link - performance help needed

I am looking for ways to improve the performance of my WCF communications over a mobile modem. I have a system where the clients are connected to the internet via a mobile (GPRS/3G/HSDPA) connection. This is NOT a windows mobile client, it is a full XP Professional system running .Net4.0. The clients basically use a USB mobile modem (SIM card etc) to get their internet connection. The server is connected directly to the internet via broadband. My WCF interface has 2 main methods, one sends 2 int values from the client to the server and the other sends 3 images (JPGs) to the server. As you can see one is going to take less than a second and the other is going to take maybe 30-60 seconds depending on the images size and connection speed. If we have a good mobile modem connection to the internet then everything works perfectly. The problem I have is a lot of the time I do not have a good connection. The timeout on the WCF binding is set to 120 seconds. This gives the images enough time to get across even if the connection is a bit slow.  The problem comes when the connection stops - this is a network (mobile network) problem, something like the signal drops etc. Communications never recovers. At this point after about 10 seconds of inactivity (no communications) I know that the connection will never recover. At this point the best thing I have found to do it res

SQL Server 2005 Log Shipping and subsequent FULL backups that are needed

Afternoon,   I have a few Log Shipped DBs that are working great.   Currently they are set to fire off every 15 minutes 24/7.   My question is this ... I need to get FULL backups of the source DBs in order to restore them on certain Dev boxes.   If I were to execute the full backup on one of these Log Shipped DBs ... how would it affect the log shipping process?   Is there a special method to accomplish this?   As a side note, what would be some concerns/issues if in being able to create the FULL backups and not interupt log shipping, I were to create the backup using a 3rd party tool like Quest LiteSpeed?   I sure wish we were on Enterprise, then I could create a mirror and then snapshot off it to create my backups BUT ... that is not the case as we stand today.   Thanks

Remove items from a list literally not working as needed

This is why SharePoint drives me insane.  Everything I have been able to find on the web says I *can* programmatically remove list items from a list, all I have to do is a declining loop.  I have even copied verbatium several code examples found in this forum and on the web and every last one of them gives me a "Collection was modified; enumeration operation may not execute." error in the Event log.  This is a C# Windows Form Application we want to use to remove a common announcement from any announcement list in our entire site (top down).  We can *add* it to every announcement list without issue (seperate code).  Can anyone point out to us the error in our code below? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.SharePoint; using System.Text; using System.Reflection; using System.IO; using System.Diagnostics; using System.Xml; namespace RemoveAnnouncement { public partial class RAForm : Form { public RAForm() { InitializeComponent(); } private void removeAnnouncment_Click(object sender, EventArgs e) { const string a = "Application"; try { if (tlsURL.Text.ToString() == "http://" || tlsURL.Text.ToString() == &qu

Wanted to know if windows 7 pro is needed to install sharepoint 2010? or it is better to do vmware a

Wanted to know if windows 7 pro is needed to install sharepoint 2010? or it is better to do vmware and then do virtual sharepoint 2010 development environment?

urgent help needed regarding transactional replication2005

urgent help needed regarding transactional replication2005   I did set up transactional replication on sql 2005 and also in article properties have selected to replicate foreign keys,default constraints and indexes. I checked the schema properties at publisher and subscriber and found that on one table a foreign key is not replicated which has an on delete cascade. I am not sure why is not replicating that constraint.The other table has a foreign key which is also not replicated.   I would appreciate all your help. thanks, Satya

Help needed generating filenames

I have a sorted array of files saved in the following format of filenames: XXX XXX_XX XXX_XX_XX I want to insert a new file (with a unique filename) between two given filenames (which could be in any of the 3 formats above). For eg., a new file between 401 and 403 could be inserted with name 402 and a new file between 401_01 and 401_02 could be inserted with name 401_01_01. etc The idea is to conform to the sorted list. Is there a way I could generate filenames for the files to be inserted, given the two filenames between which it needs to be inserted? Please help. PS: would it be helpful to use regex?

What version of VSExtensions for WSS is needed if our dev environment is changing from VS2008 to VS2

We currently are using VS2008 with WSS3.0 SP2 and the VSE1.2 installed. We will be converting to VS2010 in the next couple of days, so my question is -- do we still need to install WSS3.0 SP2 and VSeWSSv1.2?  My guess is that we would still need to install WSS3.0 SP2, but not sure about the VSeWSSv1.2... Any guidance would be much appreciated.

Software needed to learn Sharepoint 2010 and silverlight?

Can I use VS 2010 Express to learn sharepoint 2010 and silverlight?

Minimum Permissions Needed To See Cdc tables In System Tables Folder

What are the minimum permissions needed for a user to see the cdc tables in the System Tables folder in SQL Management Studio?DJ Baby Anne's Biggest Fan................

KB981145 for Microsoft .NET Framework 3.5 Service Pack 1 still needed for .Net Framework 4.0

Hi, KB981145 is hotfix for Microsoft .NET Framework 3.5 Service Pack 1. Its not included in Update for Microsoft .NET Framework 3.5 Service Pack 1. I want to know that Microsoft .NET Framework 4 enhancements/imporvements cover KB981145 or not. In other words, Will using .Net 4 instead of earlier versions will solve the issues fixed by KB981145 or not? Thanks

help needed re: "Invalid Database Connection"

I'm a novice at adding programs. I have Windows XP, & have tried downloading a homeschool program, but when I click on the icon on the desktop I get this message in a pop-up box: "Invalid Database Connection X Cannot Establish A Valid Database Connection / Exception message: Login failed for user 'soshome09.' Reason: Server is in single user mode. Only one administrator can connect at this time. / Please contact technical support"   *Note: the user 'soshome09' is the homeschool disk I'm trying to open. I don't even know if I'm posting this request in the right area/forum!!!! ANY/All help will be greatly appreciated! thesingingbyrds@hotmail.com
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