Asp.net - Injecting Server Side Variables Using <%#

Jul 26, 2010

I was having problems inserting a string into the following tag : <tr id="rowBulkOptions" style='<%# sBulkOptionsRowStyle %>'> Don't ask why I'm using tables sBulkOptionsRowStyle is a Public string in the aspx.vb file. Seemingly the only way I can get this to render is to put Page.DataBind() in the Page_Load, Page_PreRender etc.. However this causes me problems because Page.DataBind() binds all controls on the page. I could use <%= BUT another part of the code inserts controls into the page and apparently you can't use <%= and insert controls.Is there a way I can just say 'look, put sBulkOptionsRowStyle into the page

View 1 Replies


ADVERTISEMENT

Timers On Server-side - From A Client-side Piece, Call Off To A Server-side Piece

Apr 22, 2011

I'm trying to, from a client-side piece, call off to a server-side piece. I need to do this synchronously. On my server-side code, though, I'm calling off to another piece of code, which I want to have a maximum of, say, 10 seconds to return a value. If I don't have a response within 10 seconds, I want to force my own server piece to set my result equal to 0, and return to the client.

Here's what I have on my server-side code so far:

Public Function GetWebResult(ByVal inputParameter As Object) As WebReturnObject Implements IWebInterface.GetWebResult
Dim result As New WebReturnObject
Dim webItem As WebItem = Nothing

[CODE]...

I realize this code is not functional. The problem is that I'm unsure how I would go about getting back into GetWebResult to set the appropriate return values before it is sent back to the client.

View 1 Replies

Change The Execution Sequence (Client Side Click, Server Side Click) To (Server Side Click - Client Side Click)?

Jun 22, 2011

I am struckup with a problem from last two days. I am creating a web application using VB.NET, Ajax & RAD Controls. When user clicks on a button I want to open a RAD Window and show the list of ledgers available to the user, so that he can select one from the list. And to open that window I have to call a java script function from client side, which is already achieved using the below code.

[Code]...

View 8 Replies

C# - Send An Object From Client-side Javascript To Server-side Code Via ASP.NET?

May 23, 2011

Can I send an object from client-side javascript to server-side code via ASP.NET ?

View 5 Replies

Fire Client Side Code From Server Side At Runtime

Apr 13, 2010

I know this defeats the purpose of client side vs. server side (refer to title of this thread). What I would love to do is build my own custom progress indicator on the client showing how far a server side code has progressed. I figure if I could only get a JavaScript to fire and render a value of some control at pre-defined intervals while the server is working I could make it happen - but alas I'm beginning to believe that this is impossible. Below is some code that performs three 2 sec loops. At the end of each I want to change the visible value of a control on the browser. [Code]

View 8 Replies

Javascript - Format Data (client-side) For (server-side)

Jul 13, 2011

Using the following script:

$("#some_button").click(function() {

var changed = [];

[CODE]...

I need to send back the id, the old value from _1 and the new value from _0 back to the server. What is the best way to format this data so I can easily extract the data from the server side so I can easily email someone for example to let them know which textboxes have changed, what the old values were, and what the new values are

At the serverside level, I am using .NET-3.5 (VB). I know how to send the data bacl. and how to email the data, I just wanted to know how to best format the data at clientside before sending it back. I could have upto 50 sets of id, old, and new values to send back. Sorry for not making that clear earlier.

Example:

How can I modify the script above to generate this?

[
{
"id": "name_0",
"new": "text",

[CODE]...

View 3 Replies

Asp.net - Server Side Doesnt See Changes On Client Side?

Jan 25, 2012

I add an option to a select with jQuery. When I save with an asp button, I don't see the changes on the server side in the click event.

And the HTML is all correct after I add the option.

Is it a coding problem or I don't understand something?

$(selectCourant)
.append($("<option></option>")
.attr("value",$(dropdown).val())
.text($(dropdown + " option:selected").text()));

View 1 Replies

Javascript - Register A Client-side Event Listener On A Server-side Event?

Dec 28, 2011

Ultimately, what I want to accomplish is an AJAX-based messaging system. I already have a database table for messages, and an ASPX to add new messages (and declare old messages no longer relevant).

The current messaging system simply polls the server every 15 seconds, and re-pulls the current message set.

What I am looking to do is: On $(document).ready(), register an ajax callback function that listens for a server-side event (e.g., MessagesUpdated) On table insert/update, fire MessagesUpdated server-side.

This way, whenever the table is updated (or new records added), any clients listening know that new data is available and can re-poll the server then.

Ideally, I'd also like to make the new data available as an event argument (to minimize re-polling the db).

I can find references to something like this in other languages, but I cannot find any actual code examples to get me started.

Assuming this is possible to do via .Net, can anyone help get me started on this?

I'm using the 2.0 Framework. Also while I added a VB.Net tag, I can read C# reasonably well, so please feel free to post in either language.

View 4 Replies

Prevent An ASP.Net Webapp From Clearing Out Page Variables On VB Side?

Jun 17, 2010

I have a webapp in ASP.Net with a VB codebehind. I need a List variable I have declared to persist as long as the person is on the page, but currently any time a control posts back to the code, everything is cleared out. Can it be done with a Session variable? Those seem to me to be limited to base types, but I could be wrong.

View 4 Replies

Asp.net - Run A Server-side Exe From ASP?

Dec 28, 2009

I have an ASP program that synchronizes 2 databases. I also have a VB.NET program compiled down to an EXE that fills the source database before the synch happens. In the back of my mind I know I should be able to link the VB & ASP .NET programs together since that's the power of .NET. Alternatively, if I could run the EXE from ASP it would be just as well for my project. I do have the source to both programs. The ASP script was written with a text editor - the VB was in VB 2008 Express.

assume I know nothing of linking assemblies and such because I don't - I just read that in an article. I'd prefer ASP but if necessary I could use the ASP.NET script to launch the EXE. The code is legacy ASP with VBScript so all our ASP.NET stuff is the VB flavor as well. C# makes my other programmer's head hurt so for his sake this will have to remain VB.

Is there a way I can relatively easily launch the EXE pre-sync program and have it run when the ASP synch script starts?

The server is MS Windows Server 2003 SP2 / IIS 6.0 / the .NET version is 2.0.50727.3603.

By the way - I'd love to "learn to use .NET properly" but time is short for this project and in-depth research will have to wait.

EDIT: Aaron's answer below gets me most of the way to the solution but I'm getting:

Exception Details: System.ComponentModel.Win32 Exception: Access is denied
Source Error: Line 17: process1.Start();

SOLUTION: Aaron's answer below plus the knowledge that ~/ in MapPath is the virtual root of the website and the file to run is relative to that.

View 2 Replies

Run A Server-side Application Via ASP.Net (C# Or VB)

May 20, 2011

I wanted to build a front end web page so that I can start and stop various programs on my server remotely. I know that Shell will open something locally, but how can I make an ASP.Net page which activates programs server-side? Googling got me the "Shell" method, but I don't think that works server-side.

View 1 Replies

.net - Server Side Customvalidator (asp + .net) Not Firing?

May 16, 2011

I know this has been asked a lot, but I have a server-side custom validator that is not being fired, and I cannot find why (also, I've copied examples that work from other places and cannot make it work...)

The code:
<asp:CustomValidator ID="MyValidator" runat="server" ErrorMessage="My error message" OnServerValidate="MyValidator_OnServerValidate" />
Validate function

[Code]...

EDIT 2: Added a Page.validate() on my button code, and it does not call the server side of the validator.Also, the custom validator is being called (at least the client/javascript side of it, but not the server side)

View 3 Replies

Asp.net Dropdown Always No Selected Value On Server Side?

Feb 3, 2012

I have an asp.net dropdown like this

<asp:DropDownList width="95%" ID="RessourceComposantes" runat="server"
DataSourceID="Composantes"
DataTextField="Description" DataValueField="ComposanteID">
</asp:DropDownList>

[code]....

Is it normal that when I do dd_ressource_composante.selectedvalue on the server side I have no value. It's always "". the source looks like this :

<select name="ctl00$Tab$dd_ressource_composante" id="ctl00_Tab_dd_ressource_composante" style="width:95%;">
<option value="1">Composante</option>
<option value="3">DGAG</option>

[code]....

I just tried to fill my dropdown in vb.net and I have the same result. The dropdown is full but when I do a postback I have no selected value Actually on the server side when I put a breakpoint on the dropdown, the item count is 0. I don't understand why... It's like the 8th dropdown list in this project and everything is the same but this one doesn't work.

I don't do any binding on the page load. it's all in the aspx file well it works ONLY when I add autopostback="true" SelectedIndexChanged="dd_ressource_composante_SelectedIndexChanged" for the dropdown.And theres no code in dd_ressource_composante_SelectedIndexChanged It's vb.net for the server side?

View 5 Replies

Creating A Menu From The Server Side?

Apr 19, 2009

I am creating my menu with javascript. How possible it is that on page load it is created from the server side (VB ASP.NET) rather than the client side? And if this is possible how is this done? My main aim is that I can create menu items from a database.

View 2 Replies

IE Duplicating A Server Side Break

Nov 4, 2010

I have a issue with two breaks < Br /> appearing in IE,If I have a normal break placed like so.[code]Then looking at the source code for IE, it produces two Once which has a ID of brAddAnotherQuote and one which is simple "< br />" directly under it.This doesn't happen in Firefox

View 1 Replies

Load An Image Server-side In ASP.NET?

Apr 9, 2009

I'm trying to load an image that is in the root dir of my project:

Dim b As Bitmap = New Bitmap("img.bmp")

but it doesn't seem to find the file.

I've tried various combinations like ~img.gif, /img.gif, img.gif, ~/img.gif etc, but none seems to work. How to access the "current directory on server" in ASP.NET?

View 1 Replies

Server Side Office Automation?

Jun 22, 2011

We need to perform office automation (opening docx,doc,wrd,wpd files and saving them as .htm files) through Windows service or Web service but Microsoft does not support Microsoft Office automation in server side code.[URL]..We have understood that, "Word automation Services" feature of SharePoint server can be used to achieve this. But we are not in a position to acquire SharePoint server license.

Is there any other way to perform office automation through Windows Service or Web Service?

View 1 Replies

Call A Server Side Code On Anchor?

Dec 19, 2011

I have the following code to download a file from a FTP server

Sub DownloadFile_Sap()
Dim remoteuri As String = "http://appsrv01.shakarganj.com.pk:7778/reports/rwservlet?reptest&report=sap_dashboard"

[code].....

View 2 Replies

Execute WinForm App Server Side From Program?

Oct 28, 2009

Im trying to execute a winform app from my website (asp .net), this winforms app its execute in the server side for processing information and send email, but i need to pass some arguments, from the webpage i know how to do it, but im asking how to catch the arguments in the winform app?[code]...

View 4 Replies

Getting Null Value Of Hidden Field At Server-side

Feb 18, 2011

I am calling a Java-script function, in that i am passing the value of hidden field, that hidden field i want to use at server-side, but the value of hidden field is null.[code]...

View 1 Replies

Multithread Chat Server Side Crash

May 18, 2011

The server connects, the clients connect, one client sends a message to the server, and the server broadcasts it to the other clients. But what I want to do now is to also have the server communicate with the clients. But when I click on the server form, it freezes, and I cant do nothing.

I think this is because of me not creating a thread for the communication(I saw this on another forum), but I dont know how to do that. I copied basically all the chat program code from a site, and I dont know much of sockets and what not.

View 8 Replies

Multithread Chat Server Side Crash?

May 18, 2011

i'm doing a chat for a project, and it works like this. The server connects, the clients connect, one client sends a message to the server, and the server broadcasts it to the other clients. But what I want to do now is to also have the server communicate with the clients. But when I click on the server form, it freezes, and I cant do nothing. I think this is because of me not creating a thread for the communication(I saw this on another forum), but I dont know how to do that. I copied basically all the chat program code from a site, and I dont know much of sockets and what not.

View 2 Replies

Reordering Table Rows On Server Side

Feb 22, 2011

I have a table which contains asp radiobuttonlists (see below) for a survey. Once submitted the results are written to a database.I would like to use this same table for a similar survey, but the trouble is the question order needs to be different. The questions are the same, just in a different order. [code]

View 1 Replies

Use Of Server Side MsgBox Is Wrong In Web Application?

May 9, 2012

I have a web application based on vb.net.I used MsgBox() in my MYPage.aspx.vb where my expectation is that the user on client should click on a button and based on it I would process further.But I heard a suggestion the MsgBox() is working fine in my code cause on developer machine(my dev box) webserver is running locally. This does not work on a remote web server or in any hosted environment outside of a local server.

View 2 Replies

Use PageMethods To Call A Function From The Server Side?

Apr 25, 2012

I am trying to use PageMethods to call a function from the server side, but I am getting an error that PageMethods is undefined.

Here is what I have put into the html

<asp:ScriptManager ID="ScriptManager1" runat="server"
EnablePageMethods="True">

and here is the function from the code behind.

<System.Web.Services.WebMethod()> _
Public Function LoadChild(ByVal EntityID, ByVal EntityCat, ByVal lnType, ByVal FullExpand, ByVal lnEquip, ByVal lnTemplate) As String

and here is the call to the function using page methods.

PageMethods.LoadChild(lnEntityID, lnEntityCat, GLOBALEQUIPID, FullExpand, 0);

can anyone see why I would keep getting a PageMethods undefined error?

edit - part of the issue may be because the function isnt shared, but when shared is put in, i get this error in about 15 places. - this is refering to the session I am using - here is a snippet of the session being used that is showing an error.

prm4.Value = Session.Item("user_id")

I am getting the word session underlined with the error message below - any suggestions on how to fix this? this could fix the whole issue all together.

Error 305 Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class.

View 1 Replies

Request Server Variables From Within A Simple HTTPListener Web Server?

Dec 27, 2010

I am trying to use an Asynchronous HTTPListener to create a simple web server in VB .Net (Not ASP) This will be run as a desktop application. My only goal is to be able to request Server Variables from the client. Is there any way to do this from within a HTTPListenerWebServer? I am using the code from the MSDN VB .Net Samples:

[Code]...

View 5 Replies

.net - Place Server Side Variable In Javascript Loop?

Dec 29, 2011

I have a Server side variable by the following code

Dim mgps As New Text.StringBuilder
Public ReadOnly Property GPS() As String
Get
Return mgps.ToString
End Get

[Code]...

View 3 Replies

Asp.net - How To Display Server Side Dates In Jquery Datepicker

Feb 18, 2011

i have a textbox1 in my asp.net webform which shows the server side date i want the user would not select date using jquery datepicker earlier than the date in the textbox1 i m using the following code to show jquery calendar in other textbox2 :

[Code]...

View 1 Replies

Asp.net - Set A Server Side Parameter On An A Entity Data Source?

Oct 6, 2010

I have a gridview which I databind to EntityModel This typically looks like

something a
something b
companyID

on Login I get and set the compnay which has the ID so what in essence I want to do is on databind set the Where clause of data source to what the server side paramter for company ID is. I am sure this is super simple but it is driving me nuts

View 1 Replies

Asp.net - Take .net Server Side Arraylist And Convert To Javascript Array?

Feb 9, 2011

I have an array list on my server side that i want to use on my client side as an array how can i do this.

View 1 Replies







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