|
Dear all,
In my application i have first Datecontrol(using javascript) next followed by 2 dropdowns and finally uploader control from CuteWebUI.AjaxUploader.dll(its works like user control)
I am CuteWebUI.AjaxUploader.dll for uploader control which will show progress bar + time elapse while uploading a file it is showing postback
In IE it is working .(First i need to select date from Datecontrol followed by 2 dropdowns then need to select uploader button (like browse) and save finally)
But if the same page if i executed in Mozilla i am unable to open Datecontrol.But here i am facing one problem after selecting a file through uploader button showing postback then if i click datecontrol again now it is opening datecontrol.I am having doubt y datecontrol is not opening for first time.
Can any one help on these?Here is code for your reference.
uploadDocumentPopUp.aspx
------------------------
<%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="cc2" %>
<cc2:Uploader ID="Uploader1" runat="server" InsertText="Upload File (Max 10M)" OnFileUploaded="Uploader_FileUploaded">
<ValidateOption MaxSizeKB="10240" AllowedFileExtensions="jpg,jpeg,tiff,txt,doc,pdf,xls,rtf"/>
</cc2:Uploader>
uploadDocumentPopUp.aspx.cs
---------------------------
protected void Uploader_FileUploaded(object sender, UploaderEventArgs args)
{
Uploader uploader = (Uploader)sender;
fileName = args.FileName;
string fileNameWithOutExt = Path.GetFileNameWithoutExtension(fileName);
string fileExtension = Path.GetExtension(fileName);
fileNameWithOutExt += DateTime.Now + fileExtension;
fileNameWithOutExt = fileNameWithOutExt.Replace("/", "");
fileNameWithOutExt = fileNameWithOutExt.Replace(":", "");
fileNameWithOutExt = fileNameWithOutExt.Replace(" ", "");
ViewState["fileName"]=fileNameWithOutExt;
args.CopyTo(Server.MapPath(@"..\Documents\" + fileNameWithOutExt));
//alertMessage.Alert.Show("Document got uploaded please click upload button");
Response.Write("<script>alert('Document got uploaded successfully please click upload button!');</script>");
}
thanks in advance,
Subbu.
|
|
|
|
|
Hi,
I created a class library to do some logging and this class library need a configuraiton file to do some initialization work. I set the configuraiton file's build action to "Content".
Then I add reference to this class library from a asp.net application project. After build, the class lirary and the configuration file were put the output folder "bin".
As I begin to get the configuration files address in running, there are some errors occur because I ca't correctly locate the configuration file's address.
Please help: how could I get the configuration file's path?
thanks,
|
|
|
|
|
Hi!
You need to use the executing assembly's configuration file even for the library.
Andreas Johansson
IT Professional at Office IT Partner i Norrbotten Sweden
What we don't know. We learn. What you don't know. We teach
|
|
|
|
|
Hi,
Where is the appropriate lifecycle step we can introduce JavaScript execution in the page? can anyone please explain?
fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
Hi,
Friends i have a grid view with some coulmns like Name,Phone no etc with Edit,Delete column in grid view.
I click a row in grid view to Edit,it goes another page where i can edit all fields .Once i update i redirect the page to gridview.
I want the grid view to remain in that particular page say 4 of the grid view ie in which page i had edited the record.
Guhananth.S
|
|
|
|
|
Member 3222264 wrote: I click a row in grid view to Edit,it goes another page where i can edit all fields .Once i update i redirect the page to gridview.
Why do you do that? Its a very bad UI and not good usability wise.
Have a look at this article:Editable Nested GridView (All-in-One)[^]
This contains all the sample needed that can direct you...
|
|
|
|
|
Hi!
You should try to use a ModalPopupExtender from Ajax Toolkit to show the data that you want to edit.
This way your page will not change state and the view will remain as it was when you clicked on the row.
Andreas Johansson
IT Professional at Office IT Partner i Norrbotten Sweden
What we don't know. We learn. What you don't know. We teach
|
|
|
|
|
Hi everybody.
I'm trying to learn Javascript and Ajax, and I'm kind of lost with this thing.
The Idea is to have two dropdownlist on the page, the first one loads data from an xml file with, for example, a list of countries, and after selecting a country the second one loads towns of the selected country.
The idea is really simple, I'm following a manual but I can't make it work.
Can somebody help me please?
This is the code I write on an aspx file (VS2005), taken from the manual.
I get an error on the line
var provincias = documento_xml.getElementsByTagName("provincias")[0];
it seems that is returns null...
I'd appreciate if you could send me a link where I can find a similar idea, that I can study. Thanks.
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ejercicio 16 - Listas desplegables encadenadas</title>
<script type="text/javascript">
var peticion = null;
function inicializa_xhr()
{
if (window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
function muestraProvincias()
{
if (peticion.readyState == 4)
{
if (peticion.status == 200)
{
var lista = document.getElementById("provincia");
var documento_xml = peticion.responseXML;
var provincias = documento_xml.getElementsByTagName("provincias")[0];
var lasProvincias = provincias.getElementsByTagName("provincia");
lista.options[0] = new Option("- selecciona -");
for(i=0; i<lasProvincias.length; i++)
{
var codigo = lasProvincias[i].getElementsByTagName("codigo")[0].firstChild.nodeValue;
var nombre = lasProvincias[i].getElementsByTagName("nombre")[0].firstChild.nodeValue;
lista.options[i+1] = new Option(nombre, codigo);
}
}
}
}
function cargaMunicipios()
{
var lista = document.getElementById("provincia");
var provincia = lista.options[lista.selectedIndex].value;
if(!isNaN(provincia))
{
peticion = inicializa_xhr();
if (peticion)
{
peticion.onreadystatechange = muestraMunicipios;
peticion.open("POST", "http://localhost/Modal/cargaMunicipiosXML.php?nocache=" + Math.random(), true);
peticion.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
peticion.send("provincia=" + provincia);
}
}
}
function muestraMunicipios()
{
if (peticion.readyState == 4)
{
if (peticion.status == 200)
{
var lista = document.getElementById("municipio");
var documento_xml = peticion.responseXML;
var municipios = documento_xml.getElementsByTagName("municipios")[0];
var losMunicipios = municipios.getElementsByTagName("municipio");
lista.options.length = 0;
for(i=0; i<losMunicipios.length; i++)
{
var codigo =
losMunicipios[i].getElementsByTagName("codigo")[0].firstChild.nodeValue;
var nombre =
losMunicipios[i].getElementsByTagName("nombre")[0].firstChild.nodeValue;
lista.options[i] = new Option(nombre, codigo);
}
}
}
}
window.onload = function()
{
peticion = inicializa_xhr();
if(peticion)
{
peticion.onreadystatechange = muestraProvincias;
peticion.open("GET", "http://localhost/Modal/cargaProvinciasXML.php?nocache="+Math.random(), true);
peticion.send(null);
}
document.getElementById("provincia").onchange = cargaMunicipios;
}
</script>
</head>
<body>
<h1>Listas desplegables encadenadas</h1>
<form action="cargaProvinciasXML.php">
<label for="provincia">Provincia</label>
<select id="provincia">
<option>Cargando...</option>
</select>
<br/><br/>
<label for="municipio">Municipio</label>
<select id="municipio">
<option>- selecciona una provincia -</option>
</select>
</form>
</body>
</html>
PS: The information of tows and countries is stored on two php files with this format:
CargaprovinciasXML.php
<?php
header("Content-Type: application/xml");
$provincias["01"] = "Álava/Araba";
$provincias["02"] = "Albacete";
...
$provincias["49"] = "Zamora";
$provincias["50"] = "Zaragoza";
foreach($provincias as $codigo => $nombre) {
$elementos_xml[] = "<provincia>\n<codigo>$codigo</codigo>\n<nombre>".$nombre."</nombre>\n</provincia>";
}
echo "<provincias>\n".implode("\n", $elementos_xml)."\n</provincias>"
?>
CargaMunicipiosXML.php
<?php
header("Content-Type: application/xml");
$municipios["01"]["0014"] = "Alegría-Dulantzi";
$municipios["01"]["0029"] = "Amurrio";
...
$municipios["51"]["0013"] = "Ceuta";
$municipios["52"]["0018"] = "Melilla";
$provincia = trim($_POST["provincia"]);
$losMunicipios = $municipios[$provincia];
foreach($losMunicipios as $codigo => $nombre) {
$elementos_xml[] = "<municipio><codigo>$codigo</codigo><nombre>".$nombre."</nombre></municipio>";
}
echo "<municipios>\n".implode("\n", $elementos_xml)."</municipios>";
?>
|
|
|
|
|
hi, iam using asp.net with c#,
i want to remove browse text and decrease the size browse button of fileupload control in asp.net
i want to place like dot .... like symbol in place of browse text and decrease the size of browse button .
can you give example which helps me
|
|
|
|
|
developerit wrote: i want to place like dot .... like symbol in place of browse text and decrease the size of browse button .
You cannot!
Instead, you need to develop your own control or use a button having a file upload control hidden behind that triggers the browse button.
P.S.: I have seen you asking so many question that can be easily searched if use CodeProject Search only (not even Google!)
|
|
|
|
|
Hai all,
I need to open save as dialog in ultrawebgrid hyperlink cell click and i need to save the document
Can anyone help me plz..
Thank you
|
|
|
|
|
Hi everyone,
I created a ajaxenabledwebsite using VS2005 and using obout suite also with this...It was working well ..Last day onwards ,.aspx pages takes much time to load and status bar shows "loading designer..." .Even if it loaded,editing the markup is not possible and
F10 and F11 keys are not working for debugging..
Help me ..
Thanks in advance,
|
|
|
|
|
Hi,
How to get the control height using javascript...
usiing document.getelementbyid('x')...
|
|
|
|
|
Please read, How to get an answer to your question[^] and pay attention to item #3. You have a history of not following this guidance. "Height" and "iframe" and "Combobox" and "SlideCtrl" and more, these are short but not descriptive at all. Please follow the guidance in the future.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Apart from what Mark has said, had you done a Google, or just tried a little yourself, you must know that 'Height' is a property and would depend on controls. Few directly expose them and few expose them using Stylesheets.
|
|
|
|
|
Hi ,
i have an iframe inside an usercontrol..and just besides iframe there is an hyperlink and i have a link inside iframe(onclick of that im performing _dopostback(linkidwhichisiniframe,'')).
so my concern is when i click the hyperlink which is adjacent to iframe
i want to perform _dopostback inside iframe....
Please let me know...
|
|
|
|
|
Make a button with display:none inside the iframe. Make the onClientClick of the adjacent link a javascript function that calls the click of that hidden button. If you want specific info sent in the dopostback then you need to give far more details.
|
|
|
|
|
thanks for ur answer,but i need to have only link in the iframe and i need to call the _dopostback of the link which is inside the iframe by clicking on the link which is adjacent to iframe....
ill expalin why i want to do like that..
actually when i click on the link which is adjacent to the iframe initially ie after just the page load..the Div which contains the iframe opens..(initially the div will be in closed state)then the link which is present inside iframe is not aligned properly ie it touches the bottom border of the iframe,and when i click on the link which is inside iframe it actually firing _dopostback inside iframe so aligning properly in the middle of the iframe...so my concern is the moment when i click the link which is adjacent to iframe that time itself the alignment of link inside iframe should be proper...
|
|
|
|
|
Your layout concerns have nothing to do with how a postback works. Something with display:none will not affect layout. Your solution sounds very convoluted. If your solution doesn't work you need to be open to making changes.
|
|
|
|
|
How can I reload tiny mce editor by javascript code.
or
How can I get frequent changed content of tiny mce editor by javascript code.
My issue:
I'm not able to put restriction of no. of char limit in tiny mce editor and what first time content is there getting but when I add something and click on save button and not getting updated content.
This web application is being developed in asp.net.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
hi , iam using asp.net with c#.
in my login the user names are 0198, 0276,03....05
when the user logins then based on the first two letters digits 01,02,03
i have to display all departments in a dropdownlist
how to seprate this starting two letters when user login
can you give example which helps me
|
|
|
|
|
given
string input = "01010101";
you should get the output as the first two chars with
input.Substring(0, 2);
In general look at the Substring[^]
Best Regards
HE
|
|
|
|
|
If ur username is of String type then u can do this
String UserName = "0198";
string tempuserName = UserName.Substring(startindex,length);
the use tempUser to compare the department
Does this help u?
Tej Aj,
http://opexsolution.com/forum/[^]
|
|
|
|
|
thanks this logic helps me ......thanks for code project team
|
|
|
|
|
While you've been given fair advice on how to do this, I must urge you to consider the edge cases in your code. What happens if your user enters 1? Substring(0,2) will fail. What happens if they don't enter anything at all? What if they enter " 1"? Please ensure that your code copes with cases like these:
public void FilterDepartments(string input)
{
if (string.IsNullOrEmpty(input)) return;
string filter = input.Trim();
if (filter.Length > 1)
filter = filter.Substring(0, 2);
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|