|
A repeater is great for this, what you do is, you add your table rows/columns via a codebehind call that adds a new row on every third call. So, you initialise a variable to be 0, and you do calls for the top and bottom of each data item and then add one to that value. If that value %3 is 0, you return <tr><td> and </td></tr> otherwise you return the <td> </td> only.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If I am having hundreds of pages in my application and the user given the provision for adding new roles and assigning roles allowed or denied for locations. Considering page level security then it would end up in creating hundreds of location tags in the web.config file. And each tag should contain all the roles either in the allow or deny attribute. Is this the normal way of establishing security in such an application? And writing to web.config restarts the application. After each modification or creation of a role we have to restart the application to make the updation take effect. Then what would be the best session state management policy considering the above scenario?
|
|
|
|
|
hi all
How can i get serial hard disk by asp.net(C#).
|
|
|
|
|
On the client machine ? You can't. No way.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks
I get Serial on server !
|
|
|
|
|
Seems a strange thing to do, unless it's for server licensing.
public string GetVolumeSerial(string strDriveLetter)
{
if (strDriveLetter == "" || strDriveLetter == null) strDriveLetter = "C";
ManagementObject disk =
new ManagementObject("win32_logicaldisk.deviceid=\"" + strDriveLetter + ":\"");
disk.Get();
return disk["VolumeSerialNumber"].ToString();
}
using System.Management;
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
only you can get Serial of your Own HDD ..you can try with WMI
|
|
|
|
|
Dear Gurus,.
Would you please give me a snippet to get an URL from relative URL ? For example,
1] I have an URL like this : "~/abc/def.jpg".
2] My website application folder URL is, "http://www.myDomain.com/my_Application_folder".
3] So, I want to get the final URL for my jpg file as - "http://www.myDomain.com/my_Application_folder/abc/def.jpg".
4] Is it possible to get the application folder URL runtime without hardcoding.
Is there any class method avalable to get this full absolute URL from the relative url ? or any Snippet ? please..
Thanks and regards.
modified on Monday, January 07, 2008 3:41:21 PM
|
|
|
|
|
Please try to use this code.
Request.Url.AbsoluteUri
|
|
|
|
|
Hello all. So I have a SqlDataSource tag in an ASP page. Something like:
<asp:SqlDataSource ID="GridDataSource" runat="server" ConnectionString="..."
SelectCommand="selectStoreProcedure" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Name="Action" Type="String" Size="30" DefaultValue="GetFilteredEmployeeResources" />
<asp:Parameter Name='EmployeeId' Type='String' Size='10' DefaultValue="%" />
<asp:Parameter Name='EmployeeName' Type='String' Size='100' DefaultValue="%" />
<asp:Parameter Name='ResourceId' Type="Int32"/>
</SelectParameters>
</asp:SqlDataSource>
Now, in my code I use some user input to feed the select parameters, and I have something like:
GridDataSource.SelectParameters["EmployeeId"].DefaultValue =
txtIdEmpleado.Text.Length > 0 ? txtIdEmpleado.Text : "%";
...etc...
And then the stored procedure takes care of getting the information needed and filtered. Now, my fourth select parameter is an integer and thus I can't simply do a "like" in the sp's select query. So I made a workaround, and the 'flag' is whether or not this parameter is null.
So the question is: how can I set the parameter (programatically) to null? I tried something like:
GridDataSource.SelectParameters["ResourceId"].DefaultValue =
DBNull.Value.ToString();
but it's not working. Any idea on how can I accomplish this task?
Thanks in advance.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
Fernando A. Gomez F. wrote: it's not working. Any idea on how can I accomplish this task?
You want to pass the DbNull.Value to that parameter, right? You can try this code..
GridDataSource.SelectParameters["ResourceId"].Value = DBNull.Value;
|
|
|
|
|
Hai All,
i want a simple code in HTML Code to sent the searching query to google search. And get in a html page like odinary google
I used some code like this........
<form method="GET" action="http://www.google.com/search"><br />
<input type="text" name="q" size="32" maxlength="256" value="query string"><br />
<input type="submit" name="btnG" value="Google Search"><br />
<input type="hidden" name="site" value="default_collection"><br />
<input type="hidden" name="client" value="default_frontend"><br />
<input type="hidden" name="output" value="xml_no_dtd"><br />
<input type="hidden" name="proxystylesheet" value="default_frontend"><br />
</input></input></input></input></input></input></form>
But it is not working.
I want simple code in HTML or in ASP.Net that would work.
Please help for me.....
Thanks in Advance........
Senthil.S
Senthil S
Software Engineer
|
|
|
|
|
Can't you just build the google search URL ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
no that only i dont know to create.......
Senthil S
Software Engineer
|
|
|
|
|
Do you want to show the result in your website or in Google page?
If you want to show the result in Google, you can use the HTML. For example, if you look at <a href="http://michaelsync.net/">this site</a>[<a href="http://michaelsync.net/" target="_blank" title="New Window">^</a>], there is one search box. You can type the keyword that you want and click "Google Search" then it will show the result in Google page.
The code is like that below ~
<form target="_top" action="http://www.google.com/custom" method="get">
<table border="0" bgcolor="#ffffff">
<tbody><tr><td valign="top" nowrap="nowrap" height="32" align="left">
</td>
<td nowrap="nowrap">
<input type="hidden" value="michaelsync.net" name="domains" />
<label style="display: none;" for="sbi">Enter your search terms</label>
<input type="text" id="sbi" value="" maxlength="255" size="31" name="q" />
</td></tr>
<tr>
<td> </td>
<td nowrap="nowrap">
<table>
<tbody><tr>
<td>
<input type="radio" id="ss0" checked="" value="" name="sitesearch" />
<label title="Search the Web" for="ss0"><font size="-1" color="#000000">Web</font></label></td>
<td>
<input type="radio" id="ss1" value="michaelsync.net" name="sitesearch" />
<label title="Search michaelsync.net" for="ss1"><font size="-1" color="#000000">michaelsync.net</font></label></td>
</tr>
</tbody></table>
<label style="display: none;" for="sbb">Submit search form</label>
<input type="submit" id="sbb" value="Google Search" name="sa" />
<input type="hidden" value="pub-9763008045449359" name="client" />
<input type="hidden" value="1" name="forid" />
<input type="hidden" value="ISO-8859-1" name="ie" />
<input type="hidden" value="ISO-8859-1" name="oe" />
<input type="hidden" value="GALT:#008000;GL:1;DIV:#191919;VLC:663399;AH:center;BGC:EDF5FA;LBGC:EDF5FA;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1" name="cof" />
<input type="hidden" value="en" name="hl" />
</td></tr></tbody></table>
</form>
But if you want to show the result in your website, it can't be done without the server-side script. You have to download the Search API and register the account. then, you have to use that API in your website. If you want the example for that, you can search in Codeproject. there are a lot of article for that.
<div class="ForumSig"></div>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
|
|
|
|
|
hai thanks for ur valuble response. It is exactly wat i want
Senthil S
Software Engineer
|
|
|
|
|
Aside from using iframe...is there a better way to integrate an asp.net website inside of a php and/or jsp webpage?
I've got asp.net website that operates as a standalone site. Now I have a business request to make that site seamlessly appear inside of the php or jsp website of our customer.
Thanks!
Andy
|
|
|
|
|
|
Hi,
I have a GridView control and a button on a page. Grid view contains a list of items. Button opens up a pop up for search item on click of it. In the popup the resulting items of the search results appear. I want to add the selected item from the search results to the datagrid of the parent window. I hope I have explained the scenario clearly with my bad english. What I need is, How can I add row to the datagrid control using javascript? or Is there any other way to implement the scenario?
Thank you for your help in advanced.
Nisha S.
|
|
|
|
|
I did something like this before but can't find the code at the moment but I will try to explain my method.
Use a button to add a new blank row to the DataGrid.
On the new blank row place a clientside button which opens the popup to perform the search.
The button also passes the ClientIds of the TextBoxes (on the new row) to the popup via the querystring. The javascript for this button is built in the ItemDataBound of the DataGrid.
Now with the popup open, perform the search and use javascript to send the selected values back to the clientIds in the parent window using:
eval("window.opener." + myClientId[i] + ".value='" + myValues[i] + "';");
This isn't a very neat solution as it involves a bizarre mixture of server and client side code but hopefully it will give you some ideas.
|
|
|
|
|
I've created my own ftp client, and I retrive the files on a
folder by using the "NLST" command.
This gives me an ArrayList of the filenames in that folder.
My problem is that the filenames contains "?" instead of "æ", "ø" or "å".
I've set det Transfer Type = "TYPE A"
(I've tryed "TYPE E" and "TYPE L", but I only get a return value that this is not implemented, and I don't know how to do this, or
if it will solve my problem.)
Does anyone know how I can fix this?
Thanks in advanced
Thomas
|
|
|
|
|
The problem was in my stream reader
bytes = stream.Read(buffer, 0, buffer.Length);<br />
strMessage += Encoding.ASCII.GetString(buffer, 0, bytes);
replasing it with Encoding.Default.GetString(buffer, 0, bytes);
gave me the correct format.
But my problem dosen't stop there, for now I wan't the FileSize of the file,
this i do by:
Byte[] cmdBytes = Encoding.Default.GetBytes(("SIZE Berlinerbolle bringebær.doc"+ "\r\n").ToCharArray());<br />
stream.Write(cmdBytes, 0, cmdBytes.Length);
but then I get the "550 Berlinerbolle bringebær.doc: The system cannot find the file specified. ".
I've tried different types of encoding but it all returns somewhat the same error.
So now the quetsion is how do I sett the Encoding for an ftp site on a windows 2000 server run by IIS?
|
|
|
|
|
Hi got this code
<outputcachesettings>
<outputcacheprofiles>
<add name="myprofile" duration="360" enabled="true" location="Any" diskcacheable="false" varybycustom="langcountry">
and i got this in a control - which doesn't work, on a normal page it works but not in the control
]]>
When i compile i get this error: The directive is missing a 'duration' attribute.
and visualstudio says: CacheProfile is not a valid atribute for element outputcache
Any one has any idea how to do this in a control?
Thanks a lot
|
|
|
|
|
I've recently move company and new company currenlty uses as an interface with external clients sharepoint to provide document share and other functionality.
Since I've never used sharepoint whereby external users are accessing an internally hosted sharepoint and I was wondering if anybody could give me some pro's and con's over this approach and if there are any other alternative approaches.
One issue I have already come across is that we are using Windows Authentication which means that every user that accesses the sharepoint site has to exist on our network.
Cheers
Nathan
|
|
|
|
|
Hi all,
I have two button
<next> both are created at run time. i have a list of 10 records. if initially more than 10 records <next? button="" will="" be="" visible.="" now="" i="" have="" click="" on="" next="" both="" are="" visible="" now.="" till="" its="" working="" fine<br="" mode="hold" />
now the problem is when i click on <pre> button first time nothing is Happing :confused::confused:
and when click on 2nd time i am getting duplicated ID error!!!:confused::confused:
It may be reason of same control creating multiple time!!!!! Is there any solluation !!!!!!! :doh:
Can any body have any idea !!!!!
Thansk in Advance
|
|
|
|