Tag: c#

Passing a string value from c# file to js file

I am trying to pass a string value from c# file to js file. If I try to pass an int value, then I can pass it, but I am unable to pass string value. string value = “abc”; int a=5; TableCell.Attributes.Add(“onclick”, “F1(“+value +”)”); //NOTHING HAPPENS TableCell.Attributes.Add(“onclick”, “F1(“+a +”)”); //Works Perfectly js file function F1(value) […]

Embedding variable in HTML from another c# class

I am new to JavaScript, HTML, C# so bare with me… I am using an ASP.NET framework. Within my welcome page (after a user logs in) I want to customize the paragraph text to include their login information. For example: <p> Welcome to the website! </p> Is what the code would have currently, but what […]

How Can I open the Text file in my MVC application?

I want to fetch the Text data from a Text file :: For that, I have used code like :: public ActionResult Log() { StreamReader reader = new StreamReader(Server.MapPath(“~/Views/Builder/TestLogger.txt”)); return View(reader); } I have made this text file from “Log4Net”. I wat to know that How can I fetch the contents of this Text file […]

how to schedule task in windows for asp.net mvc 3 web applications?

Possible Duplicate: ASP.NET MVC Repeating Task I am developing MVC 3 web application. I want to do background task using task scheduler in Windows. Is it possible to create a schedule for web application in Windows? Thanks in advance

How to call a Controller method from javascript in MVC3?

Im using MVC3 architecture, c#.net. I need to compare text box content(User ID) with the database immediately when focus changes to the next field i.e., Password field. So I thought to use onblur event to the User Id field which then calls the Controller method. Can any tell me how to approach to this problem? […]

Math.POW(x,y) getting different value from x ^ y

In JavaScript 215 ^ 150 = 65 But when i try Math.POW(215, 150) in C# I am getting Infinite Why it is not 65 ? How should I get 65 in C# ?

How to call JavaScript function in GridView Command Field?

I have return one Javascript function which asks the confirm message to the user. The JavaScript functions is function ConfirmOnDelete() { if (confirm(“Are you sure to delete?”)) return true; else return false; and GridView is like below: <asp:CommandField HeaderText=”Delete” ShowDeleteButton=”True” /> Here I want to call the JavaScript function when user clicking the Delete in […]

Qt programming: How to extend Javascript API in webkit

I am new to Qt and what I am trying to do is: Create a Linux app using the Qt framework. This app displays some web pages from the Internet. I want to extend the JavaScript API to access some device and device based data, which means some devices can be controlled using JavaScript in […]

What is the easiest way to call a C# method from Javascript

I have an LinkButton control which I need to add a c# method to. Currently when I use parse control and add the control to the page it changes the call to javascript and I get undefined. I figure a way around this would be to define a javascript function that would call the c# […]

How to get value of selected checkboxlist items using javascript in asp.net

I am working on an asp.net project in which i have a checkboxlist which i have bound using DataTable dt = new Process_Hotels().SelectAllFacilty(); if (dt.Rows.Count > 0) { cblHotelFacility.DataSource = dt; cblHotelFacility.DataTextField = “Facility”; cblHotelFacility.DataValueField = “ID”; cblHotelFacility.DataBind(); foreach (ListItem li in cblHotelFacility.Items) { li.Attributes.Add(“JSvalue”, li.Value); } } and now i want to get selected […]