|
Thanks Shog9 and Mike, I now have a useful suggestion and some luck.
So, tables aren't as evil as Zen Garden type people would have us believe?
|
|
|
|
|
Brady Kelly wrote: So, tables aren't as evil as Zen Garden type people would have us believe?
Well...
Look, here's the problem. Prior to proper implementations of CSS, tables were often the only way to get the layout you wanted. That said, they're not a very good layout mechanism for non-tabular data. There were (and sadly, still are) many sites with layouts built using deep nested tables - these tended to be large, hard to parse, hard to edit, and generally difficult to work with.
That said, tables are just fine for what they were intended for - tabular data.
|
|
|
|
|
Shog9 wrote: That said, tables are just fine for what they were intended for - tabular data.
Like a table of controls?
|
|
|
|
|
If that's actually what you're going for, then sure.
|
|
|
|
|
Not really, but it's serving me nicely with a prototype today. The quicker I can get the screenshots/prototype out, the more time I have for actually thinking things through.
|
|
|
|
|
I am trying to encrypt and decrypt the password in ASP.NEt2.0 application with Rijndael
algo.
I am able to encrypt the password but not able to decrypt it.
Can anybody tell me what is the problem with my code,
I am pasting it here
public static string Encrypt(string StringToEncrypt, string Key)
{
Rijndael _encryptionservice = new RijndaelManaged();
ICryptoTransform _encryptor;
byte[] _bytesdata;
byte[] _byteskey;
string _encryptedstring;
Key = Key.ToLower();
_bytesdata = Encoding.ASCII.GetBytes(StringToEncrypt.PadRight(16));
_byteskey = Encoding.ASCII.GetBytes(Key.PadRight(32).Substring(0, 32));
_encryptionservice.Mode = CipherMode.CBC;
_encryptionservice.Key = _byteskey;
//_encryptionservice.IV = Encoding.ASCII.GetBytes("VIMSuitEncoding");
_encryptor = _encryptionservice.CreateEncryptor();
MemoryStream _memstreamencrypteddata = new MemoryStream();
CryptoStream encStream = new CryptoStream(_memstreamencrypteddata, _encryptor, CryptoStreamMode.Write);
try
{
encStream.Write(_bytesdata, 0, _bytesdata.Length);
}
catch (Exception ex)
{
throw new Exception("Error while writing encrypted data to the stream", ex);
}
encStream.FlushFinalBlock();
encStream.Close();
_encryptedstring = Convert.ToBase64String(_memstreamencrypteddata.ToArray());
return _encryptedstring;
}
public static string Decrypt(string StringToDecrypt, string Key)
{
Rijndael _encryptionservice = new RijndaelManaged();
byte[] _bytesdata;
byte[] _byteskey;
string _encryptedstring;
ICryptoTransform _decryptor;
int _decryptedstringlength;
Key = Key.ToLower();
_bytesdata = Convert.FromBase64String(StringToDecrypt);
_byteskey = Encoding.ASCII.GetBytes(Key.PadRight(32).Substring(0, 32));
_encryptionservice.Mode =CipherMode.CBC;
_encryptionservice.Key = _byteskey;
//_encryptionservice.IV = Encoding.ASCII.GetBytes("VIMSuitEncoding");
_decryptor = _encryptionservice.CreateDecryptor();
MemoryStream _memstreamencrypteddata = new MemoryStream(_bytesdata);
CryptoStream encStream = new CryptoStream(_memstreamencrypteddata, _decryptor, CryptoStreamMode.Read);
//_bytesdata = new byte[_bytesdata.Length];
try
{
_decryptedstringlength = encStream.Read(_bytesdata, 0, _bytesdata.Length);
}
catch (Exception ex)
{
throw new Exception("Error while writing encrypted data to the stream", ex);
}
encStream.Close();
//_encryptedstring = Convert.ToString(Encoding.ASCII.GetChars(_memstreamencrypteddata.ToArray())).Substring(0, _decryptedstringlength);
try
{
_encryptedstring = Convert.ToString(Encoding.ASCII.GetChars(_memstreamencrypteddata.ToArray())).Substring(0, _decryptedstringlength);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
return _encryptedstring.Trim();
}
}
|
|
|
|
|
Are you following a book or tutorial or example?
led mike
|
|
|
|
|
I am following just an example....
and it was a VB code which I had converted to C#
|
|
|
|
|
Perhaps if you told what the symptoms are... Do you get any error message?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I'm to build a small web site that allows employees to submit complaints, suggestions, compliments etc. It should also provide this data to members of a committee who will compile reports based on the employee feedback, and publish them on the site. The client has specified a frames based approach[1], with title and quick links frame(s) across the top of each page, a navigation frame containing a treeview down the left, a quick poll and newsflash frame containing a poll and or news items, down the right, and a context specific content frame in the middle.
I would like some general advice on how to best go about this, mostly using ASP.NET, but with client scripting as well. At present our company is implementing the extJS library for our large amount of client side processing, so I may be able to leverage off my colleague's experiences with that. I'm also thinking along the lines of web parts, master pages, etc. but would just like some expert advice from the CPians on what components would fit my requirements best.
[1] I've heard IFrames are evil, but I can't see why. We have just converted our main application from whole page loads back to IFrames, with a huge speed improvement. Are IFrames evil, or have people just abused them too much?
|
|
|
|
|
Brady Kelly wrote: The client has specified a frames based approach
Brady Kelly wrote: I would like some general advice on how to best go about this
Most important, try to explain that Frames are out in favor of other more modern designs. Doing that in Frames will limit usability and add complexity to the development.
Brady Kelly wrote: what components would fit my requirements best.
As always, IMHO the component that fits all requirements best is a thorough understanding of the technologies being used to develop the solution. Using third party controls to fill knowledge gaps is like squeezing a balloon.
led mike
|
|
|
|
|
led mike wrote:
As always, IMHO the component that fits all requirements best is a thorough understanding of the technologies being used to develop the solution. Using third party controls to fill knowledge gaps is like squeezing a balloon.
I have quite a solid understanding of ASP.NET, but I don't have the luxury of exploring each of the components it offers before embarking on a project. I could easily hand-code everything, but I would like to rather delegate the 'plumbing' to the people who designed ASP.NET. I would just like some feedback on best possible uses of built-in components, e.g. web parts vs. user controls etc.
The one third party library I mentioned, extJS, is not intended to fill knowledge gaps but to save time coding. We are already implementing it to great effect on other projects.
|
|
|
|
|
|
I want to have one page on a website I am creating to show any information I have. I want everyone who visits the site to see the page, but to modify it from the site itself, I want to use a login page with username/password fields to do this. You enter username and password, you see the page and can edit information on it. You don't know username/password, you can only see page, but not modify information on it.
I want this to be similar to a blog page that way, but I don't want to create a blog for this as I only want to post information to this one page and do this from anywhere as long as I have username and password. Any ideas?
In the end we're all just the same
|
|
|
|
|
Dave McCool wrote: Any ideas?
Any ideas for what? That's all basic fundamental programming stuff.
led mike
|
|
|
|
|
I have suppressed a field through its property window simply by setting Suppress to True. The field got hidden but I want the fields below it to shift up and the one right below it to occupy its position. This is not happening. Is this possible? I tried setting Relative positions through section expert but it makes no difference.
|
|
|
|
|
Hello,
I have an application that sets a cookie (for authentication purposes) after a user logs in. When I run the application locally it sets the cookie and runs as it should. However when running on the webserver it appears to not set the cookie and cause me to go back to the login screen (to basically do it over). I tested my app in Firefox and it sets the cookie fine (both locally and on the webserver). Can anyone give any insight on this? Thanks in advance.
|
|
|
|
|
Hi guys. I'm in the process of converting an ASP.NET app to HTML/Javascript and all is going well except for one xpath query that is not working the same. Here is an example of the XML I read:
<cardSKU category="sampleCat" cardType="SV" transactionType="ACTL">
<skuswipe type="FACT" length="16" />
<loadValueInfo loadValueType="VAR" loadValueMin="20" loadValueMax="99" />
<card cardID="200" carrier="POSA" region="Clear Cents" />
</cardSKU>
Unfortunately I don't have control over how the XML is constructed or I would change it to make a little more sense. What I need is the cardType for a particular region. So what I've been using in C# is the following: //card[@region='" + RegName + "']/parent::node()/@cardtype
While this works fine in ASP.NET, in Javascript it gives an EOF error at the parent::node() part. The Javascript book I have touches very briefly on xpath, and I haven't found this particular answer by researching on the net so far.
If any of you know if it is possible to use a one line query still it would be great to know what needs to be changed.
thanks!
|
|
|
|
|
Gump619 wrote: it gives an EOF error
That could be mismatched quote characters. Javascript is famous for that. I prefer to use escaping of quotes for that reason.
Also you could be running into a browser compatibility problem. This is what you deal with when moving your code from the Server (stable environment) to the Client ( crappy browser environment ).
Good luck
led mike
|
|
|
|
|
I guess i'd have tried something like this first:
...since that makes it a little more obvious what you're going for. Incidentally, you spelled cardType wrong in your xpath - XML cares about case (no idea if that's your problem though, might've just been a typo)
|
|
|
|
|
Sorry that was just an example, not copied code so it was just a typo in here.
It seems I've tried a million combinations after looking through xpath pages. Using the query above I get "Object Expected" thrown.
|
|
|
|
|
Maybe it's not the query. Have you tried a sanity test, something simple like ".", to verify you're actually calling evaluate() properly?
|
|
|
|
|
Yes that functions correctly. So do others that go top down like: //cardSKU[@category='" + CatName + "']/card[@carrier='" + CarName + "'][@region='" + RegName + "']/@amount
It is only trying to find the value of a parent while matching a child attribute where I am having this trouble. In all the xpath documents I've been reading it suggests using recursive syntax such as .. but I get the same error as when I use ::. I'm assuming the version of xpath supported in javascript is different than some of the other programs/code I am using it in.
|
|
|
|
|
Unfortunately, you're at the mercy of the XPath engine used by your browser. Since each browser has its own implementation, this can vary.
|
|
|
|
|
Thanks to a pretty helpful XPath analyzer that uses IE, and a lot of trial and error, I finally found an expression that returns exactly what I want. Just FYI here is what it looks like:
var ProductType = xmlDoc.selectSingleNode("//cardSKU[./card[@region='" + RegName + "']]/@cardtype");
I had tried using recursive notation in other expressions but I didn't think that would work since I was using something like //card[@region="something"]/./cardSKU[@cardtype] which of course doesn't work since the . has to be on the left of the /.
Anyway thanks to all for the help, roadblock cleared!
|
|
|
|