|
|
Can any tell me the the difference between asp.net file upload control and html file upload control..?
is there any filesize & file type limitation for both of these? or can we upload any file of any size?
Thanks
|
|
|
|
|
I guess you don't know what ASP.NET is and does. ASP.NET creates HTML. A HTML upload control is the ONLY way for any file upload to work, it's all a browser supports, without a java plugin or similar.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
About the filesize limitations i find these useful
http://msdn.microsoft.com/en-us/library/aa478971.aspx
|
|
|
|
|
Folks,
How can I add functions to a JavaScript type generated by using the
GenerateScriptType in a web service.
Basicly, the C# class has data members that are serialized and passed to the
client to be deserialized javascript objects whoose type bears the same name as
the c# type.
Of course, methods can not be shared.
So let's say I have a c# type
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace AddJavascriptMethodTest
{
[Serializable]
public class CDog
{
public CDog()
{
this._sColor = "Brown";
}
public CDog(string sColor)
{
this._sColor = sColor;
}
private string _sColor = null;
public string Color { get { return _sColor; } }
}
}
Then I create a web service to return an object of CDog. I also add a GenerateScriptType attribute to generate a javascript type called AddJavascriptMethodTest.CDog
using System.Web.Services;
using System.Web.Script.Services;
namespace AddJavascriptMethodTest
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class wsAnimals : System.Web.Services.WebService
{
[WebMethod]
[GenerateScriptType(typeof(CDog))]
public CDog GetDog()
{
return new CDog("Red");
}
}
}
Now, the default.aspx looks like this (and this version works fine)...
<!--<!-- BEGIN FILE: Default.aspx
<!--<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AddJavascriptMethodTest._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Add Javascript Method Test</title>
<script language="javascript" type="text/javascript">
function getADogFromTheServer()
{
AddJavascriptMethodTest.wsAnimals.GetDog(GetDog_Callback_Success, GetDog_Callback_Failure);
}
function GetDog_Callback_Success(oDog)
{
alert(oDog.Color);
}
function GetDog_Callback_Failure(oDog)
{
alert("GetDog_Callback_Failure");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/wsAnimals.asmx" />
</Services>
</asp:ScriptManager>
<div>
<input type="button" value="Get a Dog" onclick="getADogFromTheServer();" />
</div>
</form>
</body>
</html>
So, okay, you click the button, and the word "Red" is displayed in an alert.
Now, what I want to do instead is add a prototype function called
RenderForDisplay() to the Javascript type AddJavascriptMethodTest.CDog.
CDog.RenderForDisplay() would look somethig like this. It would probably be in a
seperate js file.
AddJavascriptMethodTest.CDog.prototype = {
RenderForDisplay: function()
{
return "I was given a " + this.Color + " Dog.";
}
}
So I can replace GetDog_Callback_Failure(oDog) in the Default.aspx with
function GetDog_Callback_Success(oDog)
{
alert(oDog.RenderForDisplay());
}
The AddJavascriptMethodTest.CDog type is generated by the wsAnimals.asmx file at
runtime (maybe at compile time, but I don't think so).
Perhaps I could add the RenderForDisplay() function in pageLoad, but that does
not seem the right way to go.
Any Ideas?
Brett Nieland
|
|
|
|
|
I am trying to use a dropdownlist with a textbox and a "search" button to search a table in sql 05 and display the results in textboxes. This is in c# and asp.net2.0. Any help would be greatly appreciated, thanks in advance
-KB-
|
|
|
|
|
brownk1297 wrote: I am trying
Do you mean you wrote actual code for this trivial task, or that you had the idea and hoped someone here would code it for you ? Where are you stuck ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am wanting to write code for this trivial task...i dont want anyone to write the code for me i wold just like a lil assistance in how to have a dropdownlist referencing 3 columns in a sql table and then by the column they choose type in the search criteria in the txtbox and click the button to search. So in the dropdownlist if they choose "Name" and in the textbox they type the name they want to search. I am new at asp.net and c# so i am not sure how to go about this...
|
|
|
|
|
brownk1297 wrote: I am new at asp.net and c# so i am not sure how to go about this...
OK - perhaps you should learn some ASP.NET first ? Why do people always seem to be saying 'I am new to programming, and I want to know how to do this complex task' ??
If you have three items in a drop box, then your two options are:
1 - string mash your SQL using the column name
2 - write three bits of SQL ( perhaps stored procs ) and call the right SQL based on which item was selected.
you should read up on SQL injection attacks if you're writing something that will get any real world use, and if you're building SQL in code. But, I assume no-one will ever use this, if you're new to ASP.NET and C#, you're surely not yet writing code people will use, right ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: should learn some ASP.NET first ?
I agree. The OP should find a good book on ASP.NET. Not a shortage of them out there.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Currently, I have something like this:
<asp:DataGrid>
<asp:TemplateColumn>
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
</EditItemTemplate>
</asp:TemplateColumn>
</asp:DataGrid>
I was wondering if there was a way (either behind the scenes in C#) or in the markup itself, to make it so that we don't have to duplicate the markup. There was a thread I found for the FormView control, where we could set FormView.EditItemTemplate = FormView.ItemTemplate, but unfortunately, this is not available for the DataGrid TemplateColumn type.
|
|
|
|
|
Greetings,
I think the thread you read already gave you the correct way ... its only a matter of casting the template column correctly then set the EditItemTemplate property to ItemTemplate property ... here is the code:
TemplateField colmun = this.GridView1.Columns[0] as TemplateField;
colmun.EditItemTemplate = colmun.ItemTemplate;
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Ah, I didn't think of that. Thanks.
|
|
|
|
|
Hi i am trying to upload a file to a folder in FTP...
i am using asp.net file upload control .. how can i do this ?
Santhapur
|
|
|
|
|
Search google for: upload files +ASP.NET
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Thanks for your answer..
i have done it prior to posting..
i founded two links donno which one works ?
http://www.codeguru.com/csharp/csharp/cs_internet/desktopapplications/article.php/c13163__2/
http://www.developerfusion.com/code/4340/ftp-client-library-for-c/
Santhapur
|
|
|
|
|
I can understand that you just want to brows for files and upload the file you select to the server
If this is the situation
All you need is the upload control as you did
Then create a file on the sever and copy the data as stream of bytes from client's file to server's file
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Hi,
I created a webcontrol (Textbox derivated) and I have a property that was suppose to link a Label control to it - when my control gets the focus, I'm gonna change some style from the assigned label.
Here is my code... When I select the Label, my text box disappears and show an error "Error Rendering Control ... Cannot create an object from its string representation"... How can I fix it?
public virtual Label Label
{
get
{
object label = ViewState["Label"];
if (label == null)
return null;
return (Label)Page.FindControl((string)label);
}
set
{
ViewState["Label"] = value.UniqueID;
}
}
Thanks,
Dirso
|
|
|
|
|
It would be nice when someone marks my question as a "Bad Question" tell me why. It might be the solution to my problem and I would vote for him as a big 5.
Thanks,
Dirso
|
|
|
|
|
Why are you storing the label in ViewState ? Why not just create a label and refer to it by name ?
Your core issue imo is that your code requires postback. If you want to change a page when a control gets focus, you definately want to do it on the client, in javascript.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm kinda n00bie on server controls development (big surprise hum )
I created a script (using javascript) that would do the trick of changing colors and styles.
I use this, because I'm creating several forms and in each form there are several textboxes (my textboxes) and so, everytime a textbox gets the focus, the assigned label should have it's style changed too.
Back to the problem, at design time, i want to select in the property window (of each textbox) the label it should change the style from.
I read about TypeConverters, but still not sure how to use it... I'm learning about it now..
Thanks,
Dirso
|
|
|
|
|
I'm not sure about type converters. you'd need to use the ClientID property of the label to get the client side label for your JS to use, I'd just have a property which takes the label in question and gets it's id, and then investigate making this available in the designer.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Windows Workflow foundation(WWF):
I am new to .net 2008 and i am a fresher. I have just learned some bits of practicle programming but know i want to know basics and use of WWF in .net 2008.
since i am working on simple webforms and database which is of basic level so i want to know why we use WWF and how we use this.
even on net i have found most of the learning examples in console application ,which is not comfortable for me .
Please give me some links for some WWF learning videos or learning materials for beginners.
please guide me as a teacher to fresher.
Thanks.
|
|
|
|
|
This particular forum is for ASP.NET specific questions. WPF / WCF / WF forum[^] would be the more appropriate place.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Is it possible to render a page that makes use of a masterpage to Word? I get errors involving controls need to be placed inside a form tag with runat="server". The master page has this form id="form1" runat="server" but when the page runs the ID is aspnetform. However, what I need to do is to render the page's "content" and not the entire viewable page.
Thanks!
Revolutionary: Disk drives go round and round.
modified on Monday, December 1, 2008 1:14 PM
|
|
|
|