|
Hi..thanks a lot any have i solved it....
Cheers,
fast
|
|
|
|
|
|
I have written a component that uploads a file to the user using Response.Header functionality. The problem is that after doing this, the response is ended = page wont handle more postbacks.. Need to set some predefined variables before it will work, so i thought maybe i could set the values and then perform a popup to the page that generates the download. Like clicking an href with target=_blank
Is it possible to do this from codebehind? (buttonclick)
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
1: How do I specify the width of the individual columns? I can set the overall width but don't know how to adjust the split between the row headers and the data entry/display part.
2: How can I specify the DefaultMode value at runtime, so that depending on how the user navigates to the page it loads in insert, edit, or read-only mode?
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Hi,
I am using Tree view control for navigation. I am using XmlDataSource control as the datasource for the tree view control. I have given below the Xml file content.
<?xml version="1.0" encoding="utf-8" ?>
<Countries>
<continent cont="NorthAmerica" Navigate="Header.aspx">
<country coun="United States of America">
<language lang="English"></language>
<capital cap="Washington D.C"></capital>
<cities city="Chicago"></cities>
</country>
</continent>
<continent cont="Europe">
<country coun="United Kingdom">
<language lang=" English"></language>
<capital cap="London"></capital>
<cities city="Bristol"></cities>
</country>
</continent>
</Countries>
Html source:
<asp:TreeView ID="LeftNavigation" runat="server" DataSourceID="XmlDataSource1">
<DataBindings>
<asp:TreeNodeBinding DataMember="Countries" Text="Countries" NavigateUrlField="Navigate" />
<asp:TreeNodeBinding DataMember="continent" TextField="cont"/>
<asp:TreeNodeBinding DataMember="country" TextField="coun" />
<asp:TreeNodeBinding DataMember="language" TextField="lang" />
<asp:TreeNodeBinding DataMember="captial" TextField="cap" />
<asp:TreeNodeBinding DataMember="cities" TextField="city" />
</DataBindings>
</asp:TreeView>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource>
Here the binding working fine. But the navigation is not working. I have given the NavigateUrlField="Navigate". "Navigate" is having the url in xml file. Giving the binding error @ runtime. Pls help me!
Tnx.
|
|
|
|
|
chk with Navigateurl property there is anoter property "target."
set that property and try.
|
|
|
|
|
Hello
I have a dropdownlist in edititemtemplate of the gridview. However items are long so the dropdownlist becomes too wide. What I would like to do is to have dropdownlist which is small when it is collapsed and becomes wide when the items are visible. Is it possible? If I make its widht fixed then the items are cut when they are displayed. I would like for the dropdown to become wider.
Thank you.
|
|
|
|
|
you can set the width dynamically using Javascript
function dynamicWidth(evt,conversionFactor){
var selection = document.getElementById('test');
if (!selection.minmax){
selection.minmax=[parseInt(selection.style.width),0];
for (var i=0; i<selection.options.length;i++){
if (selection[i].text.length>selection.minmax[1]){
selection.minmax[1] = selection[i].text.length*conversionFactor;
}
}
}
selection.style.width = (evt?selection.minmax[1]:selection.minmax[0]) +'px';
}
<body>
<select id="test" onclick="dynamicWidth(true,20);" onblur="dynamicWidth (false,20);" onchange="dynamicWidth(false,20);" style="width:50px;">
<option>Option one</option>
<option>Option two which is long</option>
<option>Option three which is longer</option>
<option>Option four which is even more long</option>
</select>
</body>
Make your adjustment to render the control html in this manner...
Abhishek Sur
|
|
|
|
|
I have a dropdowlist, not select. I not that the resulting HTML will be select but how can I apply your solution to dropdownlist? And the dropdownlist is in a usercontrol.
|
|
|
|
|
use Attributes.Add["onclick",
to invoke your function in client end. Well even if the dropdown is inside the user control, in browser it always renders one select. So get your select control from dropdown.clientID and invoke the function. you can use Server tag inside the javascript function to be replaced with client id.
I think you can do that .. If you still unable to do so, I will send you one code for that then.
Abhishek Sur
|
|
|
|
|
hi i am asp.net devloper and i never use asp
i would like to know what need or requirement to devlop a website in asp
please any body suggest me how i can do
i havnt any type of software like i know for php we need php setup while what need for asp.net.
|
|
|
|
|
Hi,
do you mean classic ASP or ASP.NET?
For running ASP.NET applications you need an IIS and the .NET Framework. I suggest using Visual Studio as IDE for development.
Regards
Sebastian
|
|
|
|
|
umeshdaiya wrote: hi i am asp.net devloper and i never use asp
Not sure what you mean... are you or are you not a developer? What do you mean you never use asp?
|
|
|
|
|
If you are looking to play around and develop, you can do this on your own machine by installing IIS[^].
1. You should buy a domain name from Domain Name Registrar.
2. Get a Static IP address from your Internet Service Provider.
3. Point the domain name to the IP address.
4. Install Microsoft .NET Framework 3.5
* Supported Operating Systems: Windows Server 2003; Windows Server 2008; Windows Vista; Windows XP
Try that out. Have fun!
Ranjit Viswakumar
Professional Services Specialist
HostMySite.com[^]
|
|
|
|
|
Hi,
I have a web application where i need to display a confirm box in the below manner...
in My Button_Click()event
{
///Some lines of code
Display confirm Box ...(it is better if i can apply css for this Confirm box bcos it looks better than standard one..)
Based on the response in confirm box ie if Yes ....
continue remaining lines of code.....
if NO
Come out of the button event....
}
If it is possible even in Ajax please let me know....
Please help me regarding the same...
|
|
|
|
|
use javascript and create a popup confirm box using Divs and tables
Abhishek Sur
|
|
|
|
|
You want something like this-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>CSS Popup Box</title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<script type="text/javascript">
function doConfirm(v)
{
var b = document.getElementById('btn');
b.value = 'Display dialog [last return value: ' + v + '/' + (v ? 'OK' : 'Cancel') + ']';
}
function setDisp(id, disp)
{
document.getElementById(id).style.display = disp;
}
</script>
<style type="text/css">
#confirm {
position: absolute;
top: 40px;
left: 70px;
border: outset #000 10px;
padding: 1em 3em;
display: none;
background: #a5c4cc;
}
#ok {
background: #a5cca8;
}
#cancel {
background: #d6a4a4;
}
#ok, #cancel {
padding: 2px;
margin:2px;
}
</style>
</head>
<body>
<div id="confirm">
<div>Are you sure?</div>
<input type="button" id="ok" value="OK" onclick="doConfirm(true);setDisp('confirm', 'none');" />
<input type="button" id="cancel" value="Cancel" onclick="doConfirm(false);setDisp('confirm', 'none');" />
</div>
<div><input type="button" id="btn" value="Display dialog" onclick="setDisp('confirm', 'block');" /></div>
</body>
</html>
Play with the CSS to make it look the way you want. Good luck!
Ranjit Viswakumar
Professional Services Specialist
HostMySite.com[^]
|
|
|
|
|
Thanks for ur reply....
But i need confirmBox in the middle of the asp:Button click event ie after executing some lines of code ineed to display confirm box and based on the response from the confirm box i need to continue otherwise come out of the buttonclick event....
|
|
|
|
|
Hello Everybody.
Its my first time using the CP forum. though I use the articles all the time...
I have some code that builds an XML document for each user that logs in. This xml doc should become the datasource for the navigation system.
I do not use the built-in membership system, but rather have my own "Users" table and do my own authentication etc.
The XML Document is stored in a strongly-typed Session variable (as a public property in a class module). The property name is "CurrentMap"
The problem is that setting XMLDataSource.Data to the xml snippet just doesnt work. when i log in i always see the menus belonging to the previous user which logged in. Only when continuing in the site do i see the menu items based on the current users sitemap.
For testing i used the CurrentMap.Save method to save the doc to disk, and the doc is 100% correct, exactly according to my code. the problem is only on the home page, feels like asp.net is kindly doing some caching which id like to turn off.
It may also be in regard to the events that I use to bind the datasource to the xmldoc, and I used quite a few of them. But maybe im just not using the right one...
This is happening on the code behind in a Master page in asp.net 3.5.
here is the entire relevant codebehind file for the master page:
Partial Class IMaster
Inherits System.Web.UI.MasterPage
Protected Sub Page_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.DataBinding
CheckUser()
xdsSiteMap.DataFile = ""
xdsSiteMap.Data = CurrentMap.OuterXml
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
CheckUser()
xdsSiteMap.DataFile = ""
xdsSiteMap.Data = CurrentMap.OuterXml
xdsSiteMap.DataBind()
MainMenu.DataBind()
End Sub
Protected Sub lkbLogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lkbLogout.Click
ClearUser()
CheckUser()
End Sub
Protected Sub xdsSiteMap_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles xdsSiteMap.DataBinding
xdsSiteMap.DataFile = ""
xdsSiteMap.Data = CurrentMap.OuterXml
End Sub
End Class
Here is the aspx of the master page
<td colspan="2">
<div id="MainNav" class="MainNav">
<asp:Menu ID="MainMenu" SkinID="MainMenu" runat="server"
Orientation="Horizontal" DataSourceID="xdsSiteMap" StaticDisplayLevels="2">
<DataBindings>
<asp:MenuItemBinding DataMember="siteMapNode" NavigateUrlField="url"
TextField="title" />
</DataBindings>
</asp:Menu>
<asp:XmlDataSource ID="xdsSiteMap" runat="server" DataFile="~\App_Data\SiteMap.xml" XPath="siteMap/siteMapNode"></asp:XmlDataSource>
</div>
</td>
Any ideas?
Thanks a million
|
|
|
|
|
Yes. Add Page_PreRender method to the master page. This is the later in the page's life cycle than page_load. Move the databind() call to that method, see if you get the current user.
I didn't get any requirements for the signature
|
|
|
|
|
Hi
Thank you ToddHileHoffer,
I did exactly that, but the problem remains. on the landing page i get an old map.
here is the current masterpage code
Protected Sub lkbLogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lkbLogout.Click
ClearUser()
CheckUser()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
CheckUser()
End Sub
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
xdsSiteMap.DataFile = ""
xdsSiteMap.Data = CurrentMap.OuterXml
MainMenu.DataBind()
End Sub Please reply, i cant figure this out...
|
|
|
|
|
I'm sorry your page isn't working.
Where are you setting the datasource for the MainMenu? Why don't you call xdsSiteMap.Databind() instead of MainMenu.Databind()?
Can you debug the page and set a break point on your menu or site map and verify that the data source in the PreRender method does not match the data when the page is rendered?
Another question is why are you calling CheckUser() twice? In the code above you would call CheckUser in the pageload and then agin on lkbLogout.Click(). Maybe you want to use if(!postback) in your pageload.
I didn't get any requirements for the signature
|
|
|
|
|
hi
thanks for your reply
in the end, my assumption was correct, the xds has an attribute called enavlecaching, i turned that off and all is good.
thank you for your time and interest,
it was a pleasure discussing this with you.
|
|
|
|
|
Thank you. I've been fussing with my code, on and off, for the last few days trying to figure out why I couldn't get my string output of XML data to bind to my ListView object in .Net 3.5. I found the "onPreRender" statement in another article but a separate test datalist object bound fine in the "OnLoad" event. Turning the caching off was exactly what I needed- thanks.
|
|
|
|
|
glad to be of help
|
|
|
|