ASP.NET
|
|
 |

|
So I separated some write functions, that update a XML file into separate classes, that generate a thread in the background to open, update and write the XML file using streamreader and streamwriter.
So I'm new to threads on vb managed code, and just found that StreamReader is not thread safe. I did some research and one MSDN article says I need to wrap the streamreader in textreader and synchronize.
I did some more research, stumbled across monitor.enter and monitor exit, and the singleton class, so that only 1 instance of the class can run at a time.
So I have a file called "Landing.xml" and I'm interested in only have 1 instance of the class work the file at a time.
Just looking for suggestions, or help with implementing. Will post code is someone asks.
|
|
|
|

|
Well I tried using monitor and so far so good. So I have like 15 of these class files that handle 1 xml file each, and they seem to be queuing up correctly, and waiting politely for the previous instance of itself to complete before firing again.
So the Yandex and Baidu bots have visited, and the updates were handled without error this time over the last 3 hour test period.
Well time will tell, will check the results again in the morning.
Still interested in the Singleton concept. Not quite sure how to implement it in vb
|
|
|
|

|
i want to retrieve images from a database and display them in a tiled view(at least three on a row) but i don't know how to go about that could someone please shed light on this for me?
|
|
|
|

|
Use an HTTP Handler.
Help people,so poeple can help you.
|
|
|
|

|
Hi all!
I have established a linq connexion with my database with this code behind.
And with manually set paging for 10 records.
data is shown in ListView.
How do I get the header sorting I'm using a linkbutton. Also I want to be able to insert a dropdownlist in the header. How do I receive this functionality.
With thanks in advance.
private void DisplayData(int startRow)
{
using (Origo.Vefur.Linq.dbMainDataContext db = new Linq.dbMainDataContext(Origo.WMMain.Helpers.Global.ConnectionString))
{
var empList = from el in db.owm_USERs
where el.showOnWeb == 1
select el;
ListView1.DataSource = empList.Skip(startRow).Take(10);
ListView1.DataBind();
}
}
My list view looks now like this
<asp:ListView ID="ListView1" runat="server"
onselectedindexchanged="ListView1_SelectedIndexChanged1"
onsorted="ListView1_Sorted" onsorting="ListView1_Sorting">
<LayoutTemplate>
<table id="Table1" runat="server" class="TableCSS">
<tr id="Tr1" runat="server" class="table-header">
<th align="left"><asp:LinkButton ID="lnkID" CommandArgument="id" CommandName="Sort" Text="id" runat="server" /></th>
<th align="left"><asp:LinkButton ID="lnkName" runat="server">Nafn</asp:LinkButton></th>
<th align="left">
<asp:dropdownlist runat="server" id="ddlWrokplace"
DataTextField="workplace" DataValueField='<%# Eval("workplace") %>' SelectedValue='<%# Eval("workplace") %>'></asp:dropdownlist>
</th>
But neither the sorting links nor the dropdown list are working properly
|
|
|
|
|

|
Is there a way to change or specify how virtual paths are resolved?
I'm creating a site on my machine, but for purposes of demonstration, I want to deploy it to a sub folder of an existing web site. So, on the web host, I have
wwwroot (which is the parent site)
wwwroot/demosite (which is the demo web site)
Of course, this means that a virtual path of "~/demosite.master" ain't gonna work, because that would resolve to "/demosite.master" instead of the desired "/demosite/demosite.master".
I tried using inline code, but of course that isn't allowed (some far-sighted MSoftie probably knew I was going to need to do this, and this is some sort of weird personal vendetta to prevent me from actually getting anything done).
What I want to do is to make the code change the various virtual paths used throughout the demosite, so that I don't have to remember to do it when I deploy to it's actual production server.
So, for localhost (when developing) and deployment onto the actual production server, I want to use the current virtual path, but for the demo version, I need to change the virtual path root.
Is that possible, and if so, how?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|

|
When you deploy the site, you need to make sure that the "demosite" folder is an application. In IIS Manager, right-click on the folder and select "Convert to Application". Your app-relative paths (~/demosite.master) will then resolve to the correct path.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|

|
I'm not sure I can change that, since the deployment is to a web host.
I was actually hoping for a web.config approach, or some other technique.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|

|
I am not sure if this trick may work for you, but you can create one section in configuration file indicating if you are running site for production or for testing.
if you config section says isTestMode="true" it means for testing otherwise production.
you need to add condition on every location that may be for one time. hope this may help you.
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
 |
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Rant
Admin