|
I also faced the same problem but in different scenario.
i solved by replacing
html img control ""
to asp:image server control and gave src path as "~/images/registerbidder.jpg" as in ur case.
the "~" will point the root path.
Yogesh
|
|
|
|
|
the error"
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /hog9/~/Registrator/Register_new_bidder.aspx
the code:
<a href="~/Registrator/Register_new_bidder.aspx" <>img src="~/Images/registerbidder.jpg" border="" /></a>
i tried it still cant could it be because each of my subfolder have an web.config?
|
|
|
|
|
do it in server control
Convert
<a href="~/Registrator/Register_new_bidder.aspx" ><img
src="~/Images/registerbidder.jpg" border="" /></a>
as
a ---> asp:hyperlink
img --> asp:image
Yogesh
|
|
|
|
|
Hello All,
Can someone help me in finding Id of dynamically created webserver control like textbox, dropdownlist etc, when these server control placed in aspx page, but the aspx page is included in Master page.
Suppose dynamically created textbox textbox1 id changes to clt100_Main_textbox1
How to find out this id or its value using javascript
Please help in this regard.
Solution will be appreciated.
Regards
Balasaheb
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
You can access the server control in javascript by its property called "clientid"
so in aspx assign a variable with the clientid of the textbox(or any server control)
ex:
var ctrid=<%= TextBox1.ClientId %>;
and use it.
Yogesh.
|
|
|
|
|
Thanks for ur reply
you r right, & I do same think in my application for all pages on which server controls are placed directly rather than created dynamically.
But for dynamically created ctrl (For now, I'll say only ctrl for dynamic server controls),
javascript function which I called unable to find out ctrl name like ctl100_Main_textbox1
Textbox textbox1 = new TextBox1();
textbox1.Attributes.Add("OnMouseOver","FunTest("+ textbox1.ClientID + ")");
Function FunTest(obj)
{
var a = document.getElementById(obj);
return a;
}
above javascript function return null even control is present on page.
Can u help me in this regard
Balasaheb
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
In this particular case try use like
Textbox textbox1 = new TextBox1();
textbox1.Attributes.Add("OnMouseOver","FunTest(this)");
and "this" will give the object and you can use in ur "Funtext" function...
like
obj.value 'No need of getElementById
try this....
Sorry if i am wrong....
Yogesh
-- modified at 2:47 Friday 30th March, 2007
|
|
|
|
|
I'll try and get back to u.
Before that, I want to explain another situation.
The javascript function which is working perfectly for physical page (not dynamic)
function callcal(obj,objTxt)
{
//alert(obj.id + " " + objTxt);
var curleft = curtop = 0;
if (obj.offsetParent)
{
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent)
{
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
//var objtxtid = document.getElementById(objTxt);
//alert(objTxt + " " + objtxtid );
var x= document.getElementById(objTxt).value ;
var y= document.forms[0].name;
window.open("DatePicker.aspx?Form="+ y + "&Field="+objTxt+"&Value=" + x + "&hField=<%=hfTargetResponsedate.ClientID %>","","top="+ curtop +", left= "+ curleft +" width=280, height=190, status=0");
return false;
}
Here u find objTxt & x. Forget about IF part inside function, just concentrate on 'x=' part. The x returns null on function call.
Now how this function gets called?
string strImage = "";
strImage = strImage + " ";
HtmlAnchor objAnc = new HtmlAnchor();
objAnc.ID = "lnkDate" + strCtrlID;
//objAnc.Name = strCtrlID;
objAnc.InnerHtml = strImage;
objAnc.Style.Add("text-decoration", "none");
//txtTargetResponseDate
objAnc.Attributes.Add("onclick", "javascript:return callcal(this,'" + txtloc.ClientID + "')");
clChield2.Controls.Add(objAnc);
Look for callcal function above for objAnc and I send clientID of textbox which is dynamically created.
Please let me know about ur view/solution
Regards
Balasaheb
By click on image, it should open popup with proper page size
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
ok ..
as u have passed "this" i.e object totally to function use it
x= obj.value;
================
anyway as of ur function it should work!!!
|
|
|
|
|
I got the solution.
If developer is using dynamic control,then they should use control's Prerender event in order to send object of these controls to javascript.
Suppose ur activating Popup on click of Image img, then img_PreRender event should be used.
Image img = new Image();
img.ClientId ="imgABC"
img.ImageUrl="abc.jpg";
img.PreRender += new EventHandler(img_PreRender);
void o_PreRender(object sender, EventArgs e)
{
string str = imgABC.ClientId;
//here u can access any control ClinetId.
}
Regards
Balasaheb
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
Hi All
1.How to use windows service in webApplication?
2.what is StandloneApplication?
Thanks to all Repliers
|
|
|
|
|
Hi,
I try to make embedded WinForm in Web Application. I follow some step from this forum.
I have problem about this. I create ActiveX and put that object to webpage.aspx using CLSID. I can run im my computer, but can't run in client computer. Can you help me please?
This is the way how I expose the object:
<object id="webCamControl" classid="CLSID:6C6DD9C1-6900-45cb-842E-7284EFAAF2B2" codebase="WebCamCab.CAB" viewastext="">
I also try this way: (not show anything, just blank box)
<object id="webCamControl" classid="MyWebCam.dll#MyWebCam.WebCamCtl" viewastext="">
I put the .dll and .cab file in my web folder.
Please help me. What's wrong with my code?
Thank you very much
BR,
Lili
|
|
|
|
|
hi, all
I have one problem. I want to used javascript with treeview control in asp.net.
when selected each node of treeview I want it alert confirm message to ask me.After that confirm if I click on button "Ok" of confirm message.then I want treeview fire OnSelectedNodeChanged event.In contrast if I click on button "Cancel" of confirm message it does nothing. how can I put javascript on each node of treeview ? Anyone can help me ?
thanks
khweb
|
|
|
|
|
Hi, I have a doubt in the datagrid, that is if a button is clicked in the datagrid what are events raised what is the flow.
yamini
|
|
|
|
|
if u are putting asp:button and setting property commandName = "Select" then on click of button selectindex even will fire.
same way for commandName = "Delete" then delete event of datagrid will fire.
Thanks,
Sun Rays
|
|
|
|
|
Thanx for your infn. After this, what happens i want the complete flow till the end.
|
|
|
|
|
Hi,
i want to create version string for a file.
like if first time I am adding file in Database then it's version will be 1.0.0.0 and later on when I will make new version of that existing file it will be 1.0.0.1 and so on.....
how to do this ?
Thanks,
Sun Rays
|
|
|
|
|
Hi, i want to display the values in the itemtemplate coloumn where i have placed a textbox. I want to make the textbox visible false and true based on the condition. I have tried the code from many sites but it didnt solve my problem. I can make the textbox visible false in design time but when i try to make it visible, they are not being displayed.
code to make visble true:
datagrid1.item.coloumns[10].visible = true;
plz help me to make the textboxes visible and to get the values from the database.
Thanx,
yamini
|
|
|
|
|
hi,
u have mistaken here..
yaminilatha wrote: code to make visble true:
datagrid1.item.coloumns[10].visible = true;
when u want to make it visible u have to first find the control and then can make it visible = true.
here is code in vb.net
dim text1 as new textbox
text1 = ctype(datagrid1.item.coloumns[10].findcontrol(IDofTextbox),textbox)
text1.visible = true
or u can make it false
text1.visible = false
Thanks,
Sun Rays
|
|
|
|
|
Thanx, for your infn. I tried this code also but i got the error near ctype, like no method exists.
|
|
|
|
|
Sun Rays wrote: here is code in vb.net
u convert in c#
Thanks,
Sun Rays
|
|
|
|
|
Hi plz answer the following if possible.
1. What happens if there is no global.asax file in asp.net project, will it run.
2. What happens if there is no web.config file in asp.net project, will it run.
3. How many web.config files can a asp.net project can have.
Thanx,
yamini
|
|
|
|
|
1. Nothing is gonna happen, if you don't have a Global.asax file. But you can't write code for the events such as the Session start and application start.
2. A web.config file will be added to your site by default. And if you delete it.
I think the site is not gonna work. As all the connection strings , debug attributes and a whole lot of things reside in this file.
3. You can have as many web.config files as you want.
|
|
|
|
|
Thanx, for your infn.Is Nothing going to happen to the project if there would be many web.config files means there wont be any confusion if i write session infn in one file, connection string in one file and security aspects in one file.
yamini
|
|
|
|
|
Hi,
I wish to know whether it is possible to create an application in asp.net/C# that can manage the controls in another application? (Like a control panel tool)
For ex.,let us say that an application has a label called Reference. While installing the app, if the label is irrelevant, i should be able to use the other application to disable the label.
Is that possible?
|
|
|
|