value(Byte Array) send from server side(.aspx) to client side(vbscript).

Hi,

I am facing some problem in retrieval of value(Byte Array) from server side(.aspx) to client side(vbscript).

I am using the code at button click event

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

{

System.Drawing.Image objImage = System.Drawing.Image.FromFile("C:/2.gif");

MemoryStream objMemoryStream =
new MemoryStream();

 

objImage.Save(objMemoryStream,System.Drawing.Imaging.ImageFormat.Gif);

objByte = objMemoryStream.GetBuffer();

txtByteArr.Value = Convert.ToString(objByte);

}

where txtByteArr is the input hidden field and runat server.

 when i retrieve this value in vbscript then get an error of undefined value.

Public Sub GetValue()

Dim ByteArr()

ByteArr = txtByteArr.value          'Getting error here, due to not parsing value to Byte Array

End Sub

 Please suggest me or tell me another way of passing Byte Array from .aspx page to vbscipt function.

0
almighty_in
4/18/2008 5:42:36 AM
asp.net.free-for-all 9281 articles. 0 followers. Follow

7 Replies
715 Views

Similar Articles

[PageSpeed] 58


You need to convert the Byte array into Base64 format string.

txtByteArr.Value
  = Convert.ToBase64String(objByte);

you can convert this base64 format string into byte again.

Satalaj


Watch The true story of internet ||Yet another forum |||
I'm big fan of Open source flash chart for .net very very simple
I n t e r v i e w T i p s
0
satalaj
4/18/2008 6:22:05 AM

and how will you do conversion to byte array at client side (vbscript)...........

0
almighty_in
4/18/2008 6:27:55 AM
0
satalaj
4/18/2008 7:12:51 AM

Satalaj,

the following link has coversion from Base64 to string and vise versa not to ByteArray.

0
almighty_in
4/18/2008 10:45:50 AM

Can you tell me what do you want to achive.
 I think you want to bind the images stored on server to Client sde IE. am I right.



Satalaj


Watch The true story of internet ||Yet another forum |||
I'm big fan of Open source flash chart for .net very very simple
I n t e r v i e w T i p s
0
satalaj
4/18/2008 11:17:32 AM

Yahhh!!!

0
almighty_in
4/18/2008 12:03:32 PM
Reply:

Similar Artilces:

Problem accessing server side array values from javascript client side function
i faced the following problem ..i have an array that store the values of a resultset row under the server side coding.How do i retrieve them under my client side javascript function.I wrote the following coding under my client side function and it got an error.BSCStr is an array storing data from a resultset row which i did under the server side coding. From client side function: addr=addr + "&C" + i + "=" + <%=BSCStr[i]%>; First of all, you can't mix server-side and client-side code. The reason is that the protocol that is used to communicate betwee...

Problem accessing server side array values from client side javascript function
i faced the following problem ..i have an array that store the values of a resultset row under the server side coding.How do i retrieve them under my client side javascript function.I wrote the following coding under my client side function and it got an error.BSCStr is an array storing data from a resultset row which i did under the server side coding. From client side function: addr=addr + "&C" + i + "=" + <%=BSCStr[i]%>;...

Sending array data with hidden input field from client side to server side
I have some values that I'm sending with javascript to the server side code via a hidden input field.  This works great.  However, I want to find an elegant way to split the values up on the server side.  What I have below works, but it doesn't seem like a very clean solution.  Client codevar values = '&approved=1&funded=0&winprob=2'; document.form1.ipHidden.value = values.toString(); Server codeDim strValues As String = ipHidden.Value.ToString() Dim strApproved = strValues.Substring(strValues.IndexOf("approved=") + 9, 1)Dim st...

How can I set client side values as server side values?
Hi, Can anyone tell me how I can get client side values such as document.referrer, navigator.appName etc... into server side scripts? There are some client side values I'd like to set as session vars and insert into the db? How do I go about this? Thanks for any pointers Davlon PS (I'm using powersite 7.1.0.300) Pass them as page parameters, e.g., http://myserver/myurl?document.referrer=whatever&navigator.appName=yadayada Then, in your server-side script, just loop through the document.value array and get these values. -- pbm_hopethishelps, Roy Kie...

Client-side values to server-side ?
Hi! My previous query is attached below: I have implemented the below mentioned implementation . 'listbox1' on 'webform1' shows all the values from 'webform2'. I have implemented it using javascript. I would like to know that to implement validation on 'webform1', I would require the values of 'listbox1' ,which are on the client-side , to move to the server-side . I think sending a querystring will be fine but how to implement it using javascript and code-behind(C#)? Your suggestion will be appreciated. Thanks and regards, ap.       My previous query: " I am stuck wi...

Client Side values to Server Side
What is the best way to transfer Client Side values to the Server side? For example I have a variable "var1" in javascript. var1 = "sample"; How can I acquire this value in the server side?  What is the best approach for this?  Barry to send the value to the server during a postback, you need to place the value in an input control.  You could consider using a hidden textbox for that purpose.Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/ In the JavaScrip...

ASPX and MySQL (Server-Side and Client-Side)
I currently would like to have my Visual Studio Web Developer being able to manipulate MySQL inside of it so that I can do administration abilities. I have installed the MySQL .net connector and I can see the commands on the left side in the toolbox, however, they are grayed and won't let me add them to pages.  My other question is whether or not I have to do something on the serverside in order to get ASPX to recognize these commands.  Cheers!  Hi,Currently, mysql did not provide control objects to connect to MySQL databases.2nd question... Yes, you have to add a...

How to pass values from client side to server side
Hi, Is there a way to transfer variable from a client loop to a server loop. For example: var clitest = 'test'; Now I would like to get test variable from javascript into a server string variable <% sertest = ?? %> I understand that this can be done by storing a variable into a hidden control for example and than access it using server side, but when I have to transfer an array for example it get's a little more complicated. I was wondering is there more efficient approach? You can't transfer arrays, only strings. To workaround this problem pass delimited stri...

How to pass the client side values to server side?
 hello to All,Actually i wanna implement a code like... a string in HTML textbox retrieve in server side control....suppose i hv a HTML control <input type="text" id="txtHTML"/>, and dis control  txtHTML.text="abc".now i want to retrieve dis client side string "abc" in d server side textbox named "txtASP"...which hs a property runat="server"so please give me an idea how to pass values from client side to server side.... hope u understand a problem... sam.  You could do this <input type="text"...

How to pass server side array to client side
Hello Friends.....   i want an intelligent textbox.....which pop up a list of data when any character is pressed in perticular textbox.......... the data should be related fields which are stored in database .........   for that i am having a javascript...........but it is static .....it has a static array and generates output..... but i want that particular with my own datafields.......   so please any one help me...... i will be very thank full........   Thanx and regards sandeep prajapatiBhaaratRemember to click "Mark as Answer" on the post t...

Firing both Client side event and server side event for server side button
I am having some difficulties getting this to work.. I have button_click (Asp.net) and ClientClick (Javascript).  Javascript is firing fine.  Server script is not. may be you have return return false in the in the javascript which is why its not firing server side event.You should add javascript evelt like thisbutton1.onclientclick = "functionname" Function should nopt return false. Vikram www.vikramlakhotia.comPlease mark the answer if it helped you...

Issue obtaining values in server-side from dropdownlist when updating value using client-side script in master page
HiI got a page in a contentplaceholder of a master page. There is two pulldowns. I populate the first one using server side coding and then use client-side javascript. So far so good. The issue is that upon a postback I try to collect the select value of the second pulldown and there is no data in the pulldown and no selected item. I tried using control.selectedvalue (nothing) or searching the form controls Stringvariable = oForm.FindControl("Control")Thing is I've done this before in 1.1 outside of a master page and it works.Thanks in ad...

how to pass values from client side to server side #2
Hi Guys....               This is Aani....I'm using ASP.NET in C# language.i have created one webpage for get input from user(from java script inputbox).i want that entered data in server side operations.how can i pass that value from client side server side.i need proper code in C# language.reply me soon... Thanks is Advanced... Regards....Aani plz use hidden field.ur assing values to text boxes through java script. before post back call a java scipt function to assign value to hodden fieed. even u can add these ...

passing client side variable value to server side
 i have a grid and  by click on the rows, the onrowclick event is fired on client side. I want to pass the row index to the server side. As there are not sessions variables in javascript so i am stuck to pass the row to the server side.. I have made a texbox and set its valueto the index in the onrowclick event but when refresh calls, the text box became empty as the value set is on client side, i want page to persistthe value,  How can i do that? Tel me some way passing the row index to the server side?? Hi, You can call GridView_SelectedIndexChanging event on row click ev...

Web resources about - value(Byte Array) send from server side(.aspx) to client side(vbscript). - asp.net.free-for-all

VBScript - Wikipedia, the free encyclopedia
.vbs, .vbe, .wsf, .wsc (.hta, .htm, .html, .asp) VBScript ( V isual B asic Script ing Edition) is an Active Scripting language developed by Microsoft ...

EMET security tool updated to prevent VBScript God Mode attacks
... Toolkit (EMET), a free exploit prevention tool, to protect against attacks that attempt to bypass Internet Explorer's sandbox using VBScript. ...

Microsoft EMET blocks 'VBScript God Mode'
... stop processes running malicious scripts via IE’s script engine. That’s good news as it’s a particularly powerful hack, and the basic " VBScript ...

Send HTML email from VBScript using CDO
Summary : VBScript to send HTML (and plain text) email. It's 2013 and apparently there are no tools that would allow you to easily test sending ...

Microsoft Security Advisory (981169): Vulnerability in VBScript Could Allow Remote Code Execution
... about this issue, including download links for an available security update, please review MS10-022 . The vulnerability addressed is the VBScript ...

Rumours of VBScript's Death Have Been Greatly Exaggerated
li.tag-item').show(); $('#TagLessLink').show(); $('#TagMoreLink').hide(); return false;" /> More ▼ li.tag-item').hide(); $('#TagMoreLink').show(); ...

Researchers find new PoS malware written in VBScript
In the wake of a large-scale attack on point-of-sale (PoS) systems at retailer Target, new malware designed to steal payment card data from the ...

Researchers find new PoS malware written in VBScript
... on Jan. 3. The release shows that cybercriminals are increasingly interested in launching this type of attack. The malware is written in VBScript ...

Office MACROS PERIL! Age-old VBScript tactic is BACK in biz attack
'Office macro exploits only cool thing Visual Basic used for,' quips securobod The dangers of allowing Office macros have been underlined by ...

A break from the past, part 2: Saying goodbye to ActiveX, VBScript, attachEvent…
We recently posted “A break from the past: the birth of Microsoft’s new web rendering engine”, an in-depth look at the background and motivation ...

Resources last updated: 12/18/2015 10:47:57 AM