Passing Two Different References To A Function?

Oct 14, 2010

I have a function called populateList(). I want it to take a reference to a Checkboxlist or a Dropdownlist, query the DB and fill the referenced list with values.Is it possible to generalize the function to take a Checkboxlist or a Dropdownlist depending on what you pass?Or, do I have to write two different functions, one for the Checkboxlist and one for the Dropdownlist?I guess the my question is if theres a common object that covers both, like populateList(ref GeneralList list)

View 2 Replies


Similar Messages:

C# - SQL Server Reporting Services: Web References Versus Assembly References, Poor Performance

Feb 16, 2010

I am using Reporting Services to render a report directly to PDF. It requires that I use two web references: ReportExecution2005.asmx and ReportService2005.asmx. The performance on web references seems really poor. Since my web server (IIS7) and my SQL Server (2008) are on the same box, is there a way I can reference them directly? If not is there any way I can explicitly cache them or something. First load is really really slow, second load is perfectly acceptable.

View 2 Replies

Passing DataGridCommandEventArgs To A Function?

Apr 1, 2010

i have update and insert functionality, i want to use a function to resolve the data grid entered values into variables used for the sql update or insert, but can't figure out to pass the grid values to the function?

sub that gets the grid info; Sub orientData_update(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

this is what i do now in the sub and what i want to do in the function; orientationDate As Date = _ CType(e.Item.Cells(0).FindControl("orientationDate"), Label).Text

when i code up the function call such as retVariables = someFunction(e), vs complains e is not declared, ok, but how come it knows what e is when coding e.Item.Cells(0)....... as shown above? I have to do something first to e to be able to pass it to the function being called?

View 4 Replies

Web Forms :: Passing Value To Java Script Function ?

Aug 25, 2010

Here is the problem

private void Page_Load(object sender, System.EventArgs e)

View 1 Replies

Passing A String Parameter In A JavaScript Function On MVC

Jun 17, 2010

I tried to pass a string value into a JavaScript function like below: <%= "'" + prop.property_description + "'") %>) But it does not seems to be the best option, is there a better way to do the above without concatenate the string values with "'"?

View 2 Replies

Web Forms :: Passing Multiple Parameters To VB.net Function

Jan 7, 2010

Im wonding what the correct syntax is to pass 2 parameters from a Ascx control into a Vb.net function? Heres what I currently have:

<asp:Literal
ID="CommentFooterLiteral1"
Visible='<%# Eval("Approved") Or IsModerator() %>'
Text='<%# FormatFooter(Eval("Anonymous"), Eval("DisplayName"), Eval("CreatedDate")) &#43; "
" &#43; GetModeratorStatus(Eval("UserId")) %>'
runat="server"
/>

The Function "FormatFooter", needs to pass in Anonymous and DisplayName parameters. Anyone know the correct syntax for doing this?

View 2 Replies

Passing A JSON Object To A Function On Server Side?

Jun 4, 2010

I'm trying to create a JSON object on client-side and pass to a server-side function. Then instantiate it on server-side using JSON string representation.

So I create jSON object on client-side

var myJsonObject = {
"arg1": var1,
"arg2": var2
}

and pass it in to

WebForm_DoCallback(controlID, myJsonObject , null, null, null, true);

When I try to retrieve this JSON object on server-size I get as a string representation of JSON [object Object]

So in following server-side function, the argument value is [object Object]

public void RaiseCallbackEvent(string jsonObj)

I was expecting a string representation of JSON object. How do I pass in a string representation?

View 1 Replies

VS 2010 - Passing Image Control To Function In A Class?

Oct 31, 2012

I wrote a function in code behind of the aspx file to get from an SQL database the imageurl and assign it to that image's URL. This works fine so I decided to move it to a class but now the imageurl does not exist because the passed image control is now refering to system.drawing.image not the web image.

Code:
Public Sub ShowCodeImages(sProdCode As String, ByRef imgCode As Control, sConnectionString As String)

Dim sSQL As String
Dim sqlDCStock As New SqlConnection
Dim sqlDAStock As SqlDataAdapter
Dim sqlDTStock As DataTable

[Code] .....

View 1 Replies

Web Forms :: Passing Session Values To A Function In JavaScript

Feb 11, 2012

If a value is stored inĀ  a session object. How do I retrieve the session value in a function in javascript. I tried

var background1 = '<%=Session["test"]%>'

But I get blank

View 1 Replies

Passing JQuery Object And WebMethod Return Value To OnSuccess Function

Mar 31, 2010

I am calling a WebMethod from this code:

if($(this).attr("checked")) {
..
MyWebMethod(variable1, variable2, onSuccessFunction);
}

The MyWebMethod returns an integer, and I want to set $(this).attr("id") of the jQuery object above to the returned integer. Basically, I'm trying to do the equivalent of an MVC Ajax.ActionLink...AjaxOptions {UpdateTargetID =...} However, I can't figure out how to get both a reference to $(this) as well as the returned value. For example, if I do:

MyWebMethod(variable1, variable2, onSuccessFunction($(this)));

I can succesfully manipulate the jQuery object, but obviously it doesn't have the return value from the MyWebMethod. Alternatively, the first code block with a method signature of onSuccessFunction(returnValue) has the correct return value from MyWebMethod, but no concept of the jQuery object I'm looking for. Am I going about this all wrong?

View 1 Replies

Web Forms :: Passing Array Or Object To Javascript Function Using ICallbackEventHandler?

Feb 11, 2011

How would I pass an Object or Array to a function using the ICallBackEventHandler (RaisCallbackEvent)? It allows for a string argument only, if you change it to another datatype it error out. Sample Below...

[Code]....

[Code]....

View 6 Replies

Web Forms :: Passing Variable From Code Behind To A Java Script Function?

Feb 18, 2011

can I pass a variable from code behind to a javascript function. if so, do you have a sample demo.

View 1 Replies

Forms Data Controls :: Argument Passing For The Control Onclick Function?

Aug 10, 2010

i have a linkbutton inside the Datalist control while i am clicking i would like to pass the ID value of the corresponding Link button. How can i pass the id value for the onclick function?..

View 7 Replies

Passing Folder Path String To Web Service Function Via JQuery.ajax?

Apr 24, 2010

I need to perform asp.net web-service function call via jQuery and pass asp.net application path to it. That's the way I'm trying to do it (code is located within asp.net page, e.g. aspx file):

[code]...

Function call works well, but applicationPath parameter doesn't passed correctly. When I debug it I see that backslashes are removed, function gets "C:ProjectsSamplesmytestwebsite" instead of "'C:ProjectsSamplesmytestwebsite'".

View 2 Replies

Forms Data Controls :: Passing Repeater Container.dataitem To JavaScript Function?

Sep 16, 2010

I am collecting user roles into a single dimension string array.

I have a repeater that its source set to that array. The repeater template includes list of checkboxes for the values in the array.The checkbox text is set to: Text='<%# Container.DataItem %>'

All is good till this point.

But I am trying to call a javascript function triggered by clickign a checkbox and pass it the container.dataitem, but the javascript doesn't seem to be reading the value and either complain about string not being in correct format or that treats the container.dataitem as a liter. This is the trial that didn't work (I tried many different things too):

DetermineVal(<%# DataBinder.Eval(Container.DataItem) %>);
determineval is my javascript function

Can I do that with a single dimension array?

View 2 Replies

Forms Data Controls :: Passing Grid DataItem As An Argument To Javascript Function?

Oct 14, 2010

in aspx page

<cmp:MenuItemInfo Text="Delete" onclick="javascript:deleteRow('## DataItem.ClientId ##')" />
In Javascript
function deleteRow(rowId)
{
Projectgrid.deleteItem(Projectgrid.getItemFromClientId(rowId));
}

but the arument is coming as a string '## DataItem.ClientId ##' instead of correct clientID.

View 2 Replies

Forms Data Controls :: Passing GridView Row Bound Values To JavaScript Function

Oct 28, 2010

I have a GridView with an image button in a TemplateField in the last column.

I would like to pass the GridView row values (Bound Field Values - a record) to a JavaScript function to create another html table of selected records in ClientSide (like jCart-A shopping cart).

I would like to know how to pass all GridView column values to the javascript when the image at the end of the respective row is clicked.

View 5 Replies

Forms Data Controls :: Passing Multiple Arguments From A Listview To A JavaScript Function

Oct 16, 2010

I have been stuck on how to pass multiple to a JavaScript function in a item template of a list view. Below is my code. Does anyone know the process?

[Code]....

View 5 Replies

JavaScript - Mvc Script And Style References / Include Script And Style References That Will Not Break On Deployment

May 11, 2010

I'm trying to include script and style references that will not break on deployment, however I can not even get the references to work locally. I have tried using Url.Content() and MVCContrib's <%=Html.ScriptInclude("")%>.

My scripts are in a Scripts folder on the root of the site; my styles are in the usual Content/css/ folder.

The scripts render like this:

<script type="text/javascript" src="/Scripts/MicrosoftAjax.debug.js" ></script>

This will not work in a view page in the Views folder. What am I doing wrong and what is the best way to handle this?

I would have thought Url.Content() would at least work for styles but used in my master page, the link rendered

<link href="/Content/css/Site.css rel="stylesheet" type="text/css" />

This does not work, because the Master Page is in a Shared folder, so what is really the way forward with this?

View 2 Replies

Passing Comma Separated Value From .net To Stored Procedure And Using The Value In "IN" Function In Sql?

Nov 18, 2010

I have a sql query something like below.

create procedure test
(
@param1 nvarchar(max)
)
as
begin
select * from table where column1 in (@param1)
end

Now i need to pass the value of @param1 from my .net application in such a way that the above query works.

how from my vb.net code i can pass a value which is similiar to below

'1','2','3'

Main question is how do i structure value of parameter like above example from my .net application

View 3 Replies

How To Get Rid Of Any Or All References To Ajax 4

Sep 28, 2010

I looked at Ajax 4, but on my XP box I had errors I couldn't work with. So I uninstalled Ajax 4 and installed Ajax 3.5, then copied the DLL files to all the Bin directories of the web sites on the development box. I thought everything was fine, but after several hours of development, I again started getting the error:AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.

View 1 Replies

How To Identify References

Jan 19, 2010

I am starting a new website based on an existing one that I already have up and working. I copied the old website files into a new folder but it will not run. The error suggets that I need to add a reference. So my question is . . . how can I identify the references that are included in the original site?

View 3 Replies

Opinion On Indirect References?

Feb 17, 2011

I was comparing SharpArch to Spring.NET earlier, and had some thoughts.Both contain Core, Data and Web namespaces (as well as others). While SharpArch maintains them all in one assembly, Spring.NET does so in separate assemblies.Initially, I liked this concept, because one could reference the Core without indirectly referencing something they didn't need, like System.Web.However, it later occurred to me that whether or not things were combined, they still operated within the .NET space and have equal access to the GAC.So why not put things in one assembly, as long as individual elements in their namespaces do not make use of certain things?Of course, I'm talking about a base-line assembly, not an actual business solution.

View 1 Replies

VS 2010 How Do References Really Work

Jun 1, 2010

If have a folder (say "binaries") and place all the 3rd party dll's you are going to use in there. When you reference the dll in your project, what is the use of setting "Copy Local"?If you dont set Copy Local, does your code reference the dll in that folder and the folder have to be deployed with your application?

I just had another "something new" and that was a dll just have to be present apparently in the web project's bin folder.The "easy way" suggested was adding a post build like this:

Quote:xcopy "$(SolutionDir)binaries/*.dll" "$(ProjectDir)bin" /y
xcopy "$(SolutionDir)hibernate.cfg.xml" "$(ProjectDir)bin" /y
xcopy "$(SolutionDir)Log4Net.config" "$(ProjectDir)bin" /y

all that dll's get copied over, and I dont even know what is really required.Btw, I noticed with the above script that say "NHibernate.dll" get copied over, but "NHibernate.Caches.SysCache.dll" not.

View 4 Replies

Where Are Components (dll) References Stored

Mar 18, 2010

I have dlls in bin directory. I can't see where they are referenced in either solution or web.config files. So where are the references stored ?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved